String escape

Escape a string for JSON, for backslash-style languages (JS/C) or for the shell, and unescape it back. Handy when embedding text into code or config.

Escape a string for JSON, for backslash-style languages (JS/C) or for the shell, and unescape it back. Handy when embedding text into code or config.

How to use

  1. Pick the escape flavor: JSON, backslash or shell
  2. Choose Escape or Unescape (shell is escape-only)
  3. Type or paste your string
  4. Copy the escaped or unescaped output

Frequently asked questions

What does JSON escaping do?

It turns quotes, backslashes and control characters into their escape sequences so the string is valid inside JSON.

What is shell single-quote escaping?

It wraps the text in single quotes and safely encodes any embedded quote, so it survives as one literal argument.

Why does unescape say the input is invalid?

For JSON mode the text must be a valid escaped string — an unbalanced quote or a bad escape sequence can't be decoded.