Represent a literal backslash inside a string.
Section: Escaping basics
Escape a backslash
json
json
{
"path": "C:\\Users\\Ada\\file.txt"
}Explanation
Backslashes must be escaped inside JSON strings.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Escaping basics
Escape control characters
Use `\n`, `\r`, and `\t` for control characters.
JSON string containing JSON
Sometimes one field stores another JSON document as a string.
Prefer UTF-8 encoded JSON
UTF-8 is the de facto standard for JSON payloads.
Decode embedded JSON with jq
Parse a JSON string field into structured data.
Encode structured data as a JSON string
Turn a value into a JSON-encoded string.