أدوات JSON
JSON escape
Try it
Escape a string for embedding in JSON.
Loading…
How to use this tool, examples, and related tips.
Paste your raw string into the input field.
The tool instantly escapes all characters that would break valid JSON — backslashes, double quotes, newlines, tabs, and control characters.
Copy the escaped output and embed it directly into your JSON payload.
JSON has a strict syntax for string values. Certain characters — double quotes ("), backslashes (\), and control characters like newlines (\n) and tabs (\t) — must be escaped with a backslash prefix before they can appear inside a JSON string. Without escaping, these characters break JSON parsing and cause hard-to-debug errors. JSON escaping is the process of transforming a raw string so it's safe to use as a JSON value. This is distinct from URL encoding or HTML encoding — JSON has its own escape rules defined in RFC 8259.
Embedding raw text in JSON payloads — When you need to include multi-line strings, file contents, or user-generated text as a JSON value.
Debugging JSON parse errors — When a JSON string containing quotes or backslashes is silently breaking your parser.
Preparing strings for API requests — When constructing JSON request bodies manually and including dynamic content.
Working with regex patterns in JSON — Regex strings are full of backslashes that need double-escaping inside JSON.
Answers about this tool and how your data is handled.
Double quotes ("), backslashes (\), and control characters including newline (\n), carriage return (\r), tab (\t), form feed (\f), and backspace (\b). Unicode control characters (U+0000–U+001F) are also escaped.
No. URL encoding uses percent-encoding (e.g., %20 for a space) and targets a different set of characters. JSON escaping uses backslash sequences and is only relevant inside JSON string values.
No. The JSON escape tool runs entirely in your browser. No data leaves your machine.
This tool escapes a raw string so it can be safely placed as a value inside JSON. If you want to format or validate a full JSON document, use the JSON formatter & validator.
You'll get double-escaped output (e.g., \\n instead of \n). Only pass raw, unescaped strings into this tool.
نفس الفئة أولاً، ثم أدوات أخرى.
أدوات JSON
Escape a string for embedding in JSON.