DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeText / StringString Escape / Unescape

About String Escape / Unescape

String Escape / Unescape preview - Text / String tool

Escape and unescape strings for JS, JSON, HTML, or SQL. Part of the DevTools Surf developer suite. Browse more tools in the Text / String collection.

Use Cases

  • Escaping user input strings before inserting into SQL queries
  • Preparing JSON string values containing special characters
  • Escaping HTML content for safe JavaScript string embedding
  • Sanitizing log messages containing control characters

Tips

  • Choose the target language before escaping for correct syntax
  • Escape SQL strings to prevent injection in manual queries
  • Toggle between escape and unescape modes with one click

Fun Facts

  • SQL injection, first documented by Jeff Forristal in Phrack Magazine in 1998, remains in the OWASP Top 10 over 25 years later.
  • The backslash escape character was introduced by the C programming language in 1972 and adopted by nearly every language since.
  • JSON requires only two characters to be escaped: the backslash and the double quote, plus control characters below U+0020.

FAQ

Which escape formats are supported?
JavaScript, JSON, HTML, SQL, Python, Go, Shell, and CSS. Each has its own escape rules; the tool picks the right one based on your target.
Does it escape or unescape?
Both — toggle direction. Useful for inspecting escape sequences in logs (unescape) or generating embedded literals in source code (escape).
What's the difference between JS and JSON escaping?
JSON is stricter: it requires double quotes, forbids trailing commas, and escapes a smaller character set. JS allows single quotes and a few more unescaped characters (forward slashes, single quotes).
Are unicode characters handled?
Yes — `\uXXXX` and `\x##` escape sequences are produced or consumed based on the target. ASCII-safe mode escapes all non-printable and non-ASCII characters.

Related Text / String Tools

URL EncoderURL DecoderHTML Entity EncodeHTML Entity DecodeJWT DecoderLorem Ipsum GeneratorWord CounterText Diff
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf919+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback