JSON Escape / Unescape

Embed any text safely inside a JSON string — quotes, newlines, tabs and backslashes handled for you.

About this tool

To put arbitrary text inside a JSON value, characters like quotes, backslashes, newlines and tabs must be escaped with backslash sequences. Doing that by hand is error-prone; this tool produces a correct JSON string literal from any input, and decodes one back into plain text.

How to use it

  1. Type or paste the raw text, or click Sample.
  2. Click Escape ▸ to get a quoted JSON string such as "line one\nline two", or paste a literal and click ◂ Unescape.
  3. Copy the result directly into your JSON document or source code.

Good to know

  • The escaped output includes the surrounding double quotes, exactly as it should appear in JSON.
  • Unescaping accepts input with or without the surrounding quotes.
  • Control characters are emitted as standard escapes (\n, \t, \uXXXX), so the result is valid on any platform.