HTML entity, JSON string, C escape, quoted-printable and MIME encoded-word escaper

Encode or decode HTML entities, JSON strings, C-style escapes, quoted-printable bodies and RFC 2047 MIME encoded words as inert text.

FluffyShield Protected workspace
From
To

Convert to

Choose text conversion

FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

Which format does your text need?

A quotation mark or a less-than sign in your text can look like an instruction to the app that reads it next. FluffyBench's Text escaper rewrites those characters in the spelling your destination expects, and turns escaped text back into plain words.

The job at a glance
  1. Choose From and To for where the text is going
  2. Paste your text
  3. Check the result
  4. Copy it or download it

What it does

Limits The result is text to paste somewhere else. FluffyBench's Text escaper doesn't build a web page or send an email.

Why does text need escaping?

Every format has a few characters that mean something special. In a web page, a less-than sign starts a tag; in a JSON value, a quotation mark ends the text. Escaping writes those characters another way, so the next app reads them as plain text instead of as an instruction. It's a bit like putting a word in quotation marks when you're talking about the word itself: the reader sees "stop" without stopping.

So the right spelling depends on where your text is going. Here's one short message written for five destinations, with the From and To choices that make each one.

Say "hi" <3 written for a web page as Say &quot;hi&quot; &lt;3, for a JSON value as "Say \"hi\" <3", for a code string as Say \"hi\" <3, for an email body as Say=20"hi"=20<3 and for an email subject as =?UTF-8?Q?Say_=22hi=22_=3C3?=. The escaped parts are highlighted.

One message, five destinations

The highlighted parts are the escapes. Everything else stays as you typed it. How we measured

Is your text going into a web address instead? Addresses use their own rules, called percent-encoding, and FluffyBench's URL encoder handles those.

Doing it in FluffyBench's Text escaper

Here's how to turn Say "hi" <3 into a JSON string, step by step on a phone. Every other destination works the same way; only the From and To choices change.

  1. Choose From: Text, what you have, and To: JSON string, where it's going.

  2. Paste Say "hi" <3 into Input. Short text updates on its own, with no button to press.

  3. On a phone, open Result. Check the escaped text before you use it: the label says JSON string, the outer quotes are added and the inner quotes get a backslash, "Say \"hi\" <3".

    The Result tab, outlined, with "Say \"hi\" <3" under the JSON string label and its character count.
    The Result tab, outlined, with "Say \"hi\" <3" under the JSON string label and its character count.
  4. Take the result to another app with Copy, or save it with Download.

Text for a web page or for code

For text on a web page, choose To: HTML entities. Each character that HTML would read as markup becomes a short code called a character reference, and the browser turns it back into the character on screen.

Here's a menu line with an ampersand and a less-than sign, on its way into a web page.

Fish & chips <£5 becomes Fish &amp; chips &lt;£5 in the page's HTML, and a visitor sees Fish & chips <£5 again. &amp; stands for an ampersand, and &lt; for a less-than sign.

Text, its HTML entities, and what a visitor sees

The codes live in the page's HTML. Visitors only ever see the original characters.

These references are made for text between HTML tags. An attribute, a script or a link inside the page follows its own rules, so this mode isn't a safety filter for text you got from someone else.

Code works differently. A JSON string and C-style escapes both put a backslash in front of each special character, but only JSON wraps the whole value in quotes.

Here's a two-line note with a Windows folder and a quotation in it, spelled both ways. Notice the \\: a backslash in your text needs a backslash of its own.

The two lines Save to C:\temp and then "done" become "Save to C:\\temp\nthen \"done\"" as a JSON string, with outer quotes, and Save to C:\\temp\nthen \"done\" as C-style escapes, without them.

One note as a JSON string and as C-style escapes

Choose JSON string when the destination wants a complete JSON value, and C-style escapes when you're pasting between quotes that are already in your code.

Got a JSON string and want the plain words back? Reverse the choices: From: JSON string and To: Text.

  1. Choose From: JSON string, the escaped value you have, and To: Text, the plain words you want.

  2. Paste the whole string, quotes included, and the plain words come back under the Text label: Say "hi" <3.

    The result Say "hi" <3 under the Text label.
    The result Say "hi" <3 under the Text label.

The JSON choices here handle one string value at a time. A whole JSON document, with its objects and lists, needs a different tool.

Need to format or validate strict JSON?

Have a whole CSV export to turn into JSON?

Text for an email's message body

Email has its own rules, and the message body and the subject line follow different ones. For the body, choose From: Body text and To: QP, short for quoted-printable. Plain letters stay readable, and everything else becomes an equals sign followed by a two-character code for one byte.

Here's a two-line note with an accent and one very long first line.

The note becomes three quoted-printable lines. é is written as =C3=A9 and each space as =20. The first line ends with = because it was too long; that soft break is joined back up when the text is decoded. The second line ends at the note's real line break.

A note as quoted-printable

A soft break keeps every line at 76 characters or fewer. Only the real line break survives decoding.

Here's a shorter note encoded in FluffyBench's Text escaper.

  1. Choose From: Body text, the words of your message, and To: QP.

  2. Each é and space becomes an = code: check that é is =C3=A9 and each space is =20. The line break stays a line break.

    The QP result Caf=C3=A9=20opens=20at=209. on one line and See=20you=20there! on the next, under the QP label.
    The QP result Caf=C3=A9=20opens=20at=209. on one line and See=20you=20there! on the next, under the QP label.

To read an encoded body, or to check one before you send it, reverse the choices.

  1. To read it back, choose From: QP, the encoded body you have, and To: Body text.

  2. The same words return, on the same two lines. Line breaks come back as CRLF, the two-character line ending email uses.

    The Body text result: Café opens at 9. and See you there! on two lines.
    The Body text result: Café opens at 9. and See you there! on two lines.

Attaching a file instead of typing a message? A file travels as Base64, which is a different job from escaping text.

Need to encode file bytes as a data URL?

Text for an email's subject line

A subject line is a single line at the top of the email, and it uses a different trick called a MIME encoded word. Choose From: Header text, then To: MIME B or MIME Q. Paste only the subject itself, not the word Subject: in front of it.

Here's one subject line with an accent and an emoji, in both styles.

Café menu 🙂 becomes =?UTF-8?B?Q2Fmw6kgbWVudSDwn5mC?= with MIME B and =?UTF-8?Q?Caf=C3=A9_menu_=F0=9F=99=82?= with MIME Q. Both start with =?UTF-8? and a letter for the style, and end with ?=. In Q, an underscore is a space.

A subject line as MIME B and MIME Q

Either style works in a subject line. Q keeps plain letters readable; B comes out shorter here because the accent and emoji take several bytes each.

A subject line can't hold a line break, so a two-line value gets a message instead of a result.

A two-line subject refused for MIME B, with the Text escaper's message that encoded words hold a single header value.

Two-line subject, MIME B

Text with line breaks belongs in the message body, with QP.

Reading a subject that arrived as =?UTF-8?…? Choose From: Encoded words and To: Header text.

  1. Choose From: Encoded words, the =?UTF-8? value you have, and To: Header text.

  2. The subject reads normally again under the Header text label, accent and emoji included: Café menu 🙂.

    The Header text result: Café menu with a smiling emoji.
    The Header text result: Café menu with a smiling emoji.

Why won't my text decode?

Decoding is strict: when the input isn't quite what From promises, FluffyBench's Text escaper tells you what's wrong instead of guessing.

The most common snag is a JSON string that lost a quotation mark in copying. FluffyBench's Text escaper points to where the string falls apart.

A JSON string missing its closing quote, with the Text escaper's message that the string is missing a closing quote.

Missing closing quote

Copy the whole value, from its first quotation mark to its last, and the words come back.

A few other messages you might see. C-style escapes reads the common backslash codes, such as \n, \t, \" and \\; hex, octal and Unicode codes like \x41 stop with a message, because they're outside that set. QP input has to be plain ASCII, with every other character already written as an equals code. Encoded words must be UTF-8 and need a space between them and any ordinary text.

Search FluffyBench