# String Escaper & Unescaper

> Escape strings for JSON, JavaScript, CSV, SQL, XML or shell — and unescape them again.

To escape a string, paste it above and choose the target format. The tool handles JSON and JavaScript string literals, CSV fields, SQL single-quoted values, XML and HTML entities, POSIX shell quoting and regular-expression metacharacters, and can unescape JSON back to plain text.

**URL:** https://convertto.tech/t/string-escaper
**Category:** Text Tools (https://convertto.tech/c/text-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## How to use

1. Enter or paste your text.
2. Choose the format.
3. The result appears immediately — copy or download it.

## FAQ

### Why does escaping differ between languages?

Because each defines its own set of characters that need protecting. JSON escapes quotes, backslashes and control characters; SQL doubles single quotes; a shell needs to protect spaces, dollars and backticks. Applying the wrong one leaves an injection open.

### Is escaping enough to prevent injection?

It is the last resort, not the first. Parameterised queries in SQL and proper templating in HTML remove the problem structurally. Manual escaping is correct only where no parameterised interface exists.

## Related tools

- [JSON Flattener](https://convertto.tech/t/json-flattener): Flatten deeply nested JSON into dot-notation keys, or expand flat keys back into nested objects.
- [JSON Formatter & Validator](https://convertto.tech/t/json-formatter): Format, validate, repair and analyse JSON — with errors that point at the exact line.
- [JSON to TypeScript Converter](https://convertto.tech/t/json-to-typescript): Generate TypeScript interfaces, Zod schemas, Go structs, Python dataclasses or Rust structs from JSON.
- [JSONPath Tester](https://convertto.tech/t/jsonpath-tester): Run JSONPath expressions against a document and see the matches instantly.
- [Wrap Lines in Quotes or Brackets](https://convertto.tech/t/line-wrapper): Add a prefix and suffix to every line and join them — build SQL IN lists, arrays and CSV rows.
- [Text Reverser](https://convertto.tech/t/text-reverser): Reverse text by character, word or line — useful for puzzles, testing and mirrored strings.
- [Unicode Escape Converter](https://convertto.tech/t/unicode-escape): Convert characters to \u escape sequences and back — for JSON, JavaScript and source code.
- [Email, URL & Number Extractor](https://convertto.tech/t/data-extractor): Pull emails, URLs, IP addresses, phone numbers or hashtags out of any text.
