JSON Formatter & Validator
Pretty-print, minify and validate JSON with clear error messages.
Embedding text in JSON requires escaping quotes, backslashes and control characters. Forgetting one produces invalid JSON that is hard to debug, especially when the text itself contains JSON.
This tool turns plain text into a properly quoted and escaped JSON string literal, and does the reverse for a literal you paste. It runs locally.
Runs locally in your browser — nothing is uploaded.
A JSON string is always quoted. The escape mode returns the complete literal, ready to paste as a value.
A quoted JSON string literal, with or without the surrounding double quotes.
Escape mode turns real newlines into \n so the value stays on one line.
JSON escaping is close to JavaScript string escaping but not identical: JSON allows \u escapes for control characters and requires double quotes, while JavaScript also accepts single quotes and template literals.
Double-escaping is the usual bug: a string escaped twice shows literal backslashes in the UI. If the output looks wrong, check whether the value was already escaped upstream before it reached this page.