Escape and unescape strings for JavaScript literals.
Escape and unescape strings for safe use in SQL queries.
Convert JSON objects into valid JSON strings.
Format, indent, validate, and beautify JSON with custom spacing.
Validate JSON syntax and view exact error line, column, and diagnostic tips.
Encode or decode Base64 strings instantly with size metrics.
JSON is strict about what may appear inside a string: a raw double quote ends it, a backslash starts an escape sequence, and a literal newline or tab is simply invalid. That makes pasting arbitrary text into a JSON value surprisingly error-prone, especially when the text is itself code, a log line, or markup. This tool escapes text so it is valid inside a JSON string — quotes become \", backslashes become \\, and control characters become \n, \r, or \t — and unescapes in the other direction when you need to read an escaped value back as plain text. It is the quickest way to build a fixture, hand-edit a config value, or recover a readable stack trace from an escaped log field. The conversion round-trips exactly and runs entirely client-side, so payloads containing tokens or personal data are never uploaded.
The double quote, the backslash, and control characters below U+0020 — most commonly newline, carriage return, and tab, which become \n, \r, and \t. Everything else may appear literally.
No. JSON strings are always delimited by double quotes, so an apostrophe is an ordinary character and passes through unchanged.
This escapes text so it can be placed inside a JSON string. Stringify takes a whole JSON document and turns it into one escaped string value. Use this for a single field, and Stringify for an entire payload.
Yes. Unescape mode converts the sequences back, which is the fastest way to read an escaped log message or error string as plain text.
No. JSON is UTF-8 by default, so accented letters and non-Latin scripts are left readable rather than expanded into \u escapes.
No. The escaping runs entirely in your browser, so text containing credentials or personal data is never transmitted or stored.