JSON Escape
Escape any string so it can be embedded safely inside a JSON value. Quotes, backslashes, newlines, tabs, and control characters are handled. Runs in your browser. No data sent anywhere.
How It Works
- 1
Paste raw text
Any string. HTML, code, logs, multi-line content.
- 2
Escape runs live
Output updates as you type, no button needed.
- 3
Copy and embed
Paste the escaped string between double quotes in your JSON.
Use Cases
Embed HTML in JSON
Paste an HTML snippet into a JSON API payload without breaking the outer quotes.
Test fixture payloads
Escape log lines or error messages before embedding in a JSON test fixture.
Mock API responses
Escape multi-line content for mock servers like Mirage or MSW.
Playwright assertions
Escape expected text values for `expect(locator).toHaveText("…")` in test files.
Frequently Asked Questions
Similar tools
All toolsJSON Formatter
NewFormat, validate, and minify JSON. Clean indentation, key sorting, and exact line/column errors.
JWT Decoder
NewDecode a JSON Web Token's header and payload. Readable claim timestamps and expiry status. Decode-only.
Text Compare
Side-by-side diff with line, word, and character granularity. Export as unified diff or .patch.
YAML Compare
Diff two YAML files. Normalize mode sorts keys so you only see real changes. Kubernetes, Helm, CI.
Done generating test data? Now automate the tests.
Bug0's expert AI agents write end-to-end tests from plain English, auto-heal them when your UI changes, and run them on every deploy. A forward-deployed engineer verifies every result.
From $2,500/mo. Results in 7 days.