Developer

String escaper

One string, escaped for JSON, JS, HTML, URL and Base64 at once.

  • Instant
  • Free
  • Private (processed locally)
  • No sign-up
JSON
JavaScript
HTML
URL
Base64

The same string, ready for five contexts at once

Inserting a text string into code means escaping it for the target language. Rather than hunting for the right function each time, this tool shows the five most useful escaped forms at once — each copyable in one click.

  1. Type the string

    With quotes, accents, symbols, line breaks…

  2. Read the five results

    JSON, JavaScript, HTML, URL and Base64, live.

  3. Copy the one you need

    One button per row.

Example: He said "hi" &

TargetResult
JSON"He said \"hi\" & "
JavaScript'He said "hi" & '
HTMLHe said "hi" & <b>
URLHe%20said%20%22hi%22%20%26%20%3Cb%3E

Base64 handles UTF-8 (accents and emojis included). Reminder: Base64 is not encryption, just a reversible encoding — never use it to hide a secret.

Frequently asked questions

Why escape a string?

To insert it safely into another language without breaking the syntax or opening a vulnerability. A quote in a JSON string, an angle bracket in HTML or a space in a URL must be “escaped” so they are treated as text, not code.

What’s the difference between JSON and JavaScript?

Very close, but not identical: JSON requires double quotes, JS also accepts single quotes and has a few extra escapes. This tool gives the JSON literal (universal) and a single-quoted JS literal, ready to paste into each context.

What is URL encoding for?

To carry special characters in a URL: a space becomes %20, an & becomes %26, etc. Essential for query parameters, otherwise the server splits the URL in the wrong place. It is encodeURIComponent in JavaScript.

Is Base64 encryption?

No, and this is crucial: Base64 is a simple encoding reversible by anyone, not encryption. It carries binary data inside text (data URIs, emails), never to protect a secret.