Paste once — see escaped strings for JSON, Python, Go, C#, Rust, Java, C, Ruby, PHP, Swift, Kotlin & JS side by side
- Runs locally
- Category Encoding & Crypto
- Best for Checking small payloads, tokens, hashes, and encoded values quickly.
Enter text above to see escaped output for all 12 languages.
What this tool does
Free online string escape converter for 12 programming languages at once. Paste raw text and instantly see the correctly escaped string literal for JSON, JavaScript, Python, Go, C#, Rust, Java, C/C++, Ruby, PHP, Swift, and Kotlin — all side by side so you can copy exactly the format you need.
Unlike single-language tools, this converter shows every language simultaneously. Stop switching tabs to re-escape the same string for a different runtime. Each output follows the real escape rules of that language — Java escapes non-ASCII as \uXXXX, PHP escapes $ for variable safety, Ruby escapes # to prevent interpolation, Rust uses \u{XXXX}.
Flip to Unescape mode to decode an escaped literal back to readable text. The shared backslash parser handles \n \t \r \uXXXX \xHH and all common escape sequences. Everything runs 100% in your browser — your strings never leave the page.
Tool details
- Input
- Text + Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 20 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Encoding & Crypto · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How String Escape Converter fits into your work
Use it for quick browser-side encoding, decoding, hashing, token checks, and share-safe transformations.
Encoding jobs
- Checking small payloads, tokens, hashes, and encoded values quickly.
- Preparing values for APIs, URLs, docs, or support tickets.
- Avoiding account-based tools when the input might be sensitive.
Encoding checks
- Do not paste live secrets unless you are comfortable with local browser handling.
- Confirm whether the operation is reversible before sharing the result.
- For hashes, compare the exact algorithm and casing expected by the receiver.
Good next steps
These links move the current task into a more complete workflow.
- 1 String Escape / Unescape Escape & unescape strings for JSON, JS, Java, C, SQL, Shell, HTML, CSV & regex — both directions — browser-only Open
- 2 URL Encoder / Decoder Encode and decode URL-unsafe characters — query strings, path segments, full URLs — instant, browser-only Open
- 3 HTML Entities Encoder Encode/decode HTML entities — & < > " ' and all numeric refs — browser-only Open
Real-world use cases
Embedding user input in a multi-language backend
You have a username like O'Brien\nAdmin that needs to go into a Python config file, a Java log message, and a JSON API response body. Paste it once and the converter shows the safe form for all three environments simultaneously — no need to open three tabs or remember each language's escaping rules.
Writing test fixtures for multiple runtimes
Your QA suite runs the same assertion across a Go service, a Rust binary, and a Kotlin Android app. You have a payload string with newlines and quotes. Paste it here, grab the Go, Rust, and Kotlin outputs, and drop them into your three test files in one go.
Common pitfalls
Applying JSON escaping to a Java string literal and then wondering why javac complains about a Chinese character — Java needs \uXXXX for every non-ASCII code point; JSON does not. Use the Java row, not the JSON row.
Pasting a Python raw-string prefix (r"…") into the unescape input — raw strings are not backslash-escaped, so the parser will produce garbage. Remove the r prefix before pasting.
Forgetting to escape $ in PHP and Kotlin double-quoted strings — a bare $ followed by a letter triggers variable/template interpolation and silently inserts the wrong value. The converter handles this automatically; check the PHP/Kotlin rows even when the JSON row looks fine.
Privacy
Everything runs locally in your browser. Your strings are never sent to any server. The input text is optionally written into the page URL for shareable links — avoid pasting tokens, API keys, or confidential data if you enable sharing.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- Age Difference Calculator The exact gap between two birthdays — years/months/days, percentage, and the date one person is twice the other's age — browser-only
- AI Eval Planner Generate eval cases, pass criteria, and edge cases from an AI feature, risks, and user path.