A VS Code extension to preview unescaped strings. Perfect for working with JSON, log files, or any text containing escape sequences.
- Unescape Preview: Convert escape sequences to their actual characters and preview in a new tab
- Unescape Preview (JSON): Unescape and format as pretty-printed JSON
- Smart String Detection: Automatically extracts string at cursor position when no text is selected
- Multi-language Support: Works with any text file, supports multiple quote styles
- i18n: English and Chinese localization
- Select any text containing escape sequences
- Right-click to open the context menu
- Choose Unescape Preview or Unescape Preview (JSON)
- Place your cursor inside a string literal (between quotes)
- Right-click to open the context menu
- Choose Unescape Preview or Unescape Preview (JSON)
The extension will automatically detect and extract the string at your cursor position.
| Escape | Character |
|---|---|
\n |
Newline |
\t |
Tab |
\r |
Carriage Return |
\\ |
Backslash |
\" |
Double Quote |
\' |
Single Quote |
\b |
Backspace |
\f |
Form Feed |
\v |
Vertical Tab |
\0 |
Null |
\uXXXX |
Unicode (e.g., \u0048 → H) |
\xXX |
Hexadecimal (e.g., \x48 → H) |
The smart string detection supports various quote styles used in different programming languages:
| Quote Style | Example | Languages |
|---|---|---|
| Double quotes | "hello" |
JSON, JavaScript, Python, Java, C/C++, Go, etc. |
| Single quotes | 'hello' |
JavaScript, Python, Shell, Ruby, etc. |
| Backticks | `hello` |
JavaScript (template literals), Shell |
| Triple double quotes | """hello""" |
Python docstrings |
| Triple single quotes | '''hello''' |
Python docstrings |
| Python raw strings | r"hello\n" |
Python (no escape processing) |
| Python f-strings | f"hello {name}" |
Python (formatted strings) |
| Python byte strings | b"hello" |
Python |
| C# verbatim strings | @"hello\nworld" |
C# (no escape processing) |
| Rust raw strings | r#"hello"# |
Rust (no escape processing) |
| Command | Windows/Linux | macOS |
|---|---|---|
| Unescape Preview | Ctrl+Alt+U |
Cmd+Alt+U |
| Unescape Preview (JSON) | Ctrl+Alt+J |
Cmd+Alt+J |
Given a JSON string value:
{"message": "Hello\\nWorld\ !"}
Unescape Preview produces:
Hello
World !
Unescape Preview (JSON) with input {\"name\":\"Alice\",\"age\":30} produces:
{
"name": "Alice",
"age": 30
}| Command | Title |
|---|---|
unescaper.preview |
%unescaper.preview.title% |
unescaper.previewJson |
%unescaper.previewJson.title% |
No data
- VS Code 1.97.0 or higher