# JSON String Escape / Unescape

> Escape a string for safe embedding inside a JSON document (handles quotes, backslashes, control characters), or unescape a JSON-encoded string literal back to its raw form.

URL: https://uttir.com/json-string-escape
Categories: encoding-tools, developer-tools, data-tools
Privacy: Pure function, no upload, no server. Works fully offline.

## About

JSON strings must escape a small set of characters: the double quote, the backslash, and the control characters (U+0000 to U+001F). Everything else may appear literally.

This tool implements the standard JSON escaping rules from RFC 8259. The "escape" direction converts a raw string into a JSON-safe form (the content you would put between double quotes). The "unescape" direction parses a JSON string literal back to its raw bytes.

## How to use

1. **Pick the direction** — Escape raw → JSON or Unescape JSON → raw. Both directions round-trip cleanly for any valid input.
2. **Paste the input** — For escape, paste any string (control characters allowed). For unescape, paste the JSON-quoted content (without the surrounding quotes).
3. **Copy the output** — Use the escaped form inside a JSON config or template. Use the raw form to inspect what a stored string actually contains.

## FAQ

### Does this also parse JSON objects?

No — it only escapes / unescapes the value of a string literal. To format or validate whole JSON documents, use the JSON Formatter and JSON Validator tools.

### Are forward slashes escaped?

By default, no. JSON allows "/" inside strings (the "\/" escape is optional). The unescape function accepts both forms.

### Are unicode escapes supported?

Yes. \uXXXX is produced for control characters on escape and parsed back to the original code point on unescape.

## Related tools

- [JSON Formatter](https://uttir.com/json-formatter) — Format, beautify, and validate JSON with adjustable indentation — instantly in your browser.
- [JSON Validator](https://uttir.com/json-validator) — Check whether your JSON is valid and find the exact line and column of any syntax error.
- [URL Encoder](https://uttir.com/url-encoder) — Percent-encode text for safe use in URLs — as a query value or a full URL.
- [Base64 Encoder](https://uttir.com/base64-encoder) — Encode any text — including emoji and non-Latin scripts — into standard Base64.

---

For the full HTML page with the live tool, visit https://uttir.com/json-string-escape.
This file is the markdown rendering at https://uttir.com/json-string-escape.md. See https://uttir.com/llms.txt for a site-wide summary.
