JSON Escape
Convert ordinary text into a JSON-safe string literal and inspect the exact escaped output. The operation runs locally and supports copy-ready output.
- Direction
- Quotes
- Length
- 44 characters
- Valid
- Yes
Escaping the text into one JSON string literal, surrounding quotes included, so the result can be pasted straight into a JSON document.
Type in either box: editing the text side escapes, editing the literal side unescapes, and the conversion runs once either way. Length counts the characters of the converted side. Positions in a refusal count characters from the start of the box, beginning at 1.
Common questions
- What does JSON escaping change?
- Quotes, backslashes and control characters are represented with JSON escape sequences so the value can be embedded safely in a string.
Exact conversion by the JSON string rules, so what comes out parses as one string literal and reading it back returns the text you started with. Unescaping takes exactly one valid literal and names the position where an invalid one stops.