About C String Escape
This tool converts between plain text and C string literals for source embedding, constants, and protocol text handling.
Key Features
- C Escape: Handles backslashes, quotes, newlines, tabs, and more.
- Unescape: Restores sequences such as
\\n,\\t, and\\0. - Swap I/O: Quickly switch input and output for verification.
- Sample + Copy: Load sample text and copy output in one click.
Common Sequences
| Sequence | Meaning |
|---|---|
\\n |
newline |
\\r |
carriage return |
\\t |
tab |
\\" |
double quote |
\\\\ |
backslash |
\\0 |
null char |
Steps
- Enter source text.
- Click escape or unescape.
- Copy output into C/C++ code.
FAQ
Why does unescaped output look different?
Input may contain incomplete or mixed escape sequences. Verify original text format first.
Are octal and hex escapes supported?
Common forms are supported. For advanced cases, verify behavior with your compiler/runtime.