Code Escape Tool

Escape/unescape code strings, handling quotes, newlines, tabs and other special characters.

Conversion Settings

Source Code

Conversion Result

Escape Reference

\nNewline
\rCarriage Return
\tTab
\\Backslash
\'Single Quote
\"Double Quote
\0NULL
\bBackspace
\fForm Feed
\vVertical Tab
<Less Than
>Greater Than
&Ampersand

Usage Guide

This tool escapes or unescapes special characters in code strings, supporting multiple programming languages and quote styles.

Features

  • Supports JavaScript, Python, Java, HTML, JSON, and more languages
  • Optional single quote, double quote, backtick, or no quote wrapping
  • !Optional Unicode escaping (\uXXXX) and HTML entity escaping
  • Supports reverse operation: restore escaped strings to original characters
  • Provides common escape character reference table

Steps

  1. Select target language and quote type in "Conversion Settings"
  2. Check "Escape Unicode" or "Escape HTML Entities" as needed
  3. Enter or paste content in the "Source Code" box on the left
  4. Click "Escape →" for forward conversion, or "← Unescape" for reverse conversion
  5. View output in the "Conversion Result" box on the right, click "Copy" to copy

Notes

  • Unescaping automatically removes matching surrounding quotes
  • !HTML mode uses HTML entities for escaping (<, etc.)
  • !Unicode escaping outputs in \uXXXX or \u format
  • All conversions are done locally in the browser; data is never uploaded to any server