Text & String Utilities100% Client-Side

Add Backslashes to Escape Text

Paste text to add escape characters before straight quotes and existing backslashes. A null character is written as a backslash followed by zero. The rest of the text, including ordinary spaces and line breaks, stays in place. This helps when building a fixture that expects these particular escapes, or when you want to see exactly how a quote or backslash will be represented.

Input
20 chars•1 lines
Output

Reverse tool

Strip Slashes from Escaped Text

Restore straight quotes, literal backslashes, and null characters from supported escapes. Decode one layer and preserve unmatched backslash sequences.

Open Strip Slashes from Escaped Text
Example input
It\'s a \"test\" with \\
Example output
It's a "test" with \

How to Use the Add Slashes to Escape Quotes Online

  1. 1Paste the original text exactly as you want it represented.
  2. 2Inspect the new backslashes before each straight quote and each original backslash.
  3. 3Check whether the receiving format expects the same escape rules for those characters.
  4. 4Copy the output or use Strip Slashes to check that one layer decodes to the source.

Input & Output Examples

Both straight double quotes receive an escape backslash.

Input Sample
She said "hi".
Expected Output
She said \"hi\".

The apostrophe is escaped and the original path backslash is doubled.

Input Sample
It's in folder\draft
Expected Output
It\'s in folder\\draft

Practical Developer Workflows

  • Create escaped examples for a text fixture that tests straight quotes and backslashes.
  • Compare a single backslash in a source value with the doubled form in an escaped sample.
  • Prepare a short round-trip example with a quote next to a backslash to check escape order.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The tool escapes straight single and double quotes. Curly quotation marks remain as written. Copy the exact source text if you need to compare how both types appear in the escaped form.

Explore Other Tools

12 suggested tools

View all tools