JSON to Java Class
Generate Java POJOs or records with Jackson annotations from JSON.
Turn any text into a JSON string literal, or unwrap one back to plain text.
The JSON Escape & Unescape tool converts text into a valid JSON string literal and back again, handling quotes, backslashes, line breaks, tabs, control characters and Unicode in both directions.
A JSON string cannot hold a raw double quote, backslash, line break, tab or control character. Escaping rewrites each one as the sequence a parser accepts: a quote becomes \", a backslash becomes \\, a newline becomes \n and a tab becomes \t.
This comes up constantly when one document is embedded in another — an HTML snippet inside a JSON config, a SQL statement inside a test fixture, a stack trace inside a log payload. Unescaping goes the other way, which is what you need when a log line arrives as one long escaped string and you want to read the newlines as newlines. There is an option to wrap the result in quotes so the output is a complete literal you can paste straight into a document.
Escape to embed one document inside another, or unescape to read a log line whose newlines arrived as backslash-n.
Optionally wrap the result in double quotes so the output is a finished string you can paste straight into a document.
Tabs, form feeds, backspaces and every other character below U+0020 are escaped correctly, not just quotes and newlines.
Rewrite emoji and non-Latin scripts as \u sequences when the payload has to survive a system that is not UTF-8 clean.
Unescaping a string that was escaped twice shows you immediately, which is the usual cause of a literal that will not parse.
Escape turns plain text into a JSON string; unescape turns a JSON string back into plain text.
Any text works — HTML, SQL, a stack trace or a multi-line message.
Turn on surrounding quotes to get a complete literal, or leave it off to get just the escaped body.
The converted text updates as you type and copies with one click.
The double quote, the backslash, and every control character below U+0020 — which in practice means newline, carriage return, tab, backspace and form feed. The forward slash may be escaped but does not have to be.
Usually because it was escaped twice, so a single backslash became a double one. Unescape it once and check whether the result is what you expected before escaping again.
Yes. They pass through unchanged by default, since JSON is Unicode. Turn on ASCII-safe output to rewrite them as \u escape sequences instead.
They solve the same problem for different containers. JSON escaping makes text safe inside a JSON string; percent-encoding makes it safe inside a URL. The rules and the output look nothing alike.
What people who use the JSON Escape & Unescape think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON Escape & Unescape. It takes half a minute and no account.
Write the first reviewGenerate Java POJOs or records with Jackson annotations from JSON.
Build an HTTP Basic Authorization header from a username and password.
Reveal tabs, non-breaking spaces and zero-width characters in your text.
Generate HMAC signatures with SHA-1, SHA-256, SHA-384 or SHA-512.
Re-indent JavaScript, with strings and regular expressions left alone.
Test a regular expression live, with every match and capture group shown.
Turn an array of JSON records into INSERT statements, with an optional CREATE TABLE.
Your browser, engine, platform, languages and what it supports.