What this tool does
JSON Prompt Escaper converts prompt text into copy-ready API payload forms: JSON string literals, JSON fields, curl payloads, OpenAI message objects, and Anthropic message objects.
Escape prompts into JSON-safe strings, JSON fields, curl payloads, and OpenAI/Anthropic message content.
JSON Prompt Escaper converts prompt text into copy-ready API payload forms: JSON string literals, JSON fields, curl payloads, OpenAI message objects, and Anthropic message objects.
It helps developers paste multiline prompts into API payloads, fixtures, tests, config files, and docs without breaking JSON syntax.
The browser uses JSON serialization to escape quotes, line breaks, backslashes, tabs, and other characters that would otherwise break a JSON payload.
Paste the exact prompt text you need to include as a JSON value, then choose the copy target closest to where it will be pasted.
If an API still rejects the request, validate the entire surrounding JSON payload. The escaped prompt can be valid while the wrapper object is wrong.
Escaping happens locally in your browser.
Escaped text can be syntactically valid JSON but still semantically wrong if placed in the wrong field or double-escaped.
Unescaped quotes, backslashes, or newlines are common causes.
Yes. Double-escaping can change what the API receives.
Escape quotes, newlines, and backslashes before dropping a prompt into request bodies, fixtures, or config files.
Generate a copyable payload wrapper so shell examples do not break when prompt text contains JSON-sensitive characters.
Unescape a JSON string to inspect exactly what the model will receive before blaming the provider or SDK.
Move between OpenAI, Anthropic, and Gemini message payload builders, Markdown-to-message conversion, chat transcript formatting, and JSON prompt escaping while keeping provider-schema differences explicit.