JSON String Escape
Turn text into a JSON string literal and read an escaped literal back.
Result
Good to know
- Escaping is done by the browser's own JSON writer, so the result is exactly what a JSON parser expects — including the control characters that are easy to forget.
- Decoding accepts a literal with its quotes and one without them, so a fragment copied out of the middle of a file works as it is.
- Turkish letters are left as themselves rather than escaped. JSON is UTF-8 by definition, so ş needs no \u escape — use the Unicode tool if a system insists on one.
- Everything happens in your browser. Nothing you paste is sent to the server or stored anywhere.
27 views