Description
Serialize key as a JSON string literal using JSON.stringify and return quotedKey.
A JSON lexeme is its textual spelling, which differs from the decoded value. Escapes, quotes, raw control characters, and surrounding whitespace must be interpreted in context.
Serialize key as a JSON string literal using JSON.stringify and return quotedKey.
When to use this tool
Use JSON: JSON Key Literal Quotation when you need a narrowly defined JSON string or separator diagnostic.
How to use the tool and how it works
- Enter key. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Serialize key as a JSON string literal using JSON.stringify and return quotedKey.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| key | JSON-array serialization of the stated identifying fields, preserving exact strings. | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.quotedKey | Quoted Key | Calculated result member: string. |
{
"input": {
"key": "a\"b"
},
"output": {
"result": {
"quotedKey": "\"a\\\"b\""
}
}
} Limitations and assumptions
- This quotes a literal member name, not a full object, path, or HTML-safe embedding.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Parse the entire document when validity matters; a local pattern match cannot establish complete JSON syntax.
References
Similar or alternative tools
- JSON: JSON String Solidus Escape Choice
Serialize text using JSON.stringify.
- JSON Object Single Member Wrapper
Parse valueJson and wrap it under the literal key using a computed object property.