← All Tools

🧷 JSON Prompt Escaper

Escape prompts into JSON-safe strings, JSON fields, curl payloads, and OpenAI/Anthropic message content.

Runs in your browser

Prompt escaping runs locally in your browser. Shared links only include input when you explicitly opt in.

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.

Why it is useful

It helps developers paste multiline prompts into API payloads, fixtures, tests, config files, and docs without breaking JSON syntax.

How it works

The browser uses JSON serialization to escape quotes, line breaks, backslashes, tabs, and other characters that would otherwise break a JSON payload.

Best input

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.

Debugging tip

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.

Privacy note

Escaping happens locally in your browser.

Important limitation

Escaped text can be syntactically valid JSON but still semantically wrong if placed in the wrong field or double-escaped.

Quick answers

Why did my JSON break?

Unescaped quotes, backslashes, or newlines are common causes.

Can text be over-escaped?

Yes. Double-escaping can change what the API receives.

Common Use Cases

Paste multiline prompts into API JSON

Escape quotes, newlines, and backslashes before dropping a prompt into request bodies, fixtures, or config files.

Build curl-ready payloads

Generate a copyable payload wrapper so shell examples do not break when prompt text contains JSON-sensitive characters.

Debug double-escaped prompts

Unescape a JSON string to inspect exactly what the model will receive before blaming the provider or SDK.

LLM Message Workbench workflow

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.

💬OpenAI Message JSON Builder🟣Anthropic Message JSON Builder💎Gemini Message JSON Builder📝Markdown to Chat Messages💬Chat Transcript Formatter{}JSON Formatter
View all in Code →