About Prompt Formatter & Cleaner
Three small text utilities that come up constantly when working with LLM prompts. Format normalises whitespace, line endings and quote characters so a prompt copied from Word or a chat window doesn't bring spurious tab characters and curly quotes into your system prompt. Clean strips zero-width characters, BOM markers, non-breaking spaces and other invisibles — the kind of garbage that's invisible to you but visible to the tokenizer (and sometimes triggers prompt-injection checks). JSON Escape converts any text into a string body safe to embed inside a JSON string literal — useful when pasting a prompt into a JSON config file's `system` field. Each mode has its own tab; everything runs locally; the prompt never leaves the page.
- No uploads
- Browser-only
- Works offline
- 100% free
How it works
- 1
Pick a mode
Format / Clean / JSON Escape — three independent tabs at the top of the page.
- 2
Paste your text
The output regenerates as you type. Toggle the per-mode options to control exactly what gets transformed.
- 3
Copy the result
One-click copy of the transformed text. The diagnostics panel shows what was found — useful when debugging unexpected tokenizer behaviour.
Prompts are text, and text has a shape
Most of the difficulty in getting a useful answer out of a language model isn't cleverness — it's hygiene. A prompt pasted out of a document arrives with smart quotes, non-breaking spaces and invisible formatting characters. A prompt assembled from three sources has inconsistent line endings. A prompt that's grown over a week has duplicated instructions contradicting each other.
None of that is visible when you look at it. All of it costs tokens, and some of it changes what the model reads.
Why length is the constraint that bites
Every model has a context window — a hard ceiling on how much text it can consider at once, measured in tokens rather than characters. A token is roughly ¾ of an English word, but the ratio collapses for code, for non-Latin scripts, and for long unusual words, so 'roughly' is doing a lot of work.
Exceeding the window doesn't produce an error you'd notice; it produces silent truncation, and the part that gets cut is usually the part you added last. If a long prompt suddenly stops working, that's the first thing to check — AI Token Counter will tell you the real number rather than an estimate.
What actually makes a prompt work better
- Say what you want, not what you don't. 'Answer in three sentences' beats 'don't be verbose' — the model can act on the first and has to infer the second.
- Put the instruction near the content it governs. An instruction at the top of 4,000 words of context is competing with everything after it.
- Show an example. One worked example of the output you want is worth several paragraphs describing it.
- Cut the politeness and the preamble. 'You are a helpful assistant' is tokens spent telling a model something it already is.
- Iterate on one thing at a time. Changing three things and getting a better answer tells you nothing about which change did it.
Local, which for prompts is the whole argument
Prompts are working documents. They contain the client brief, the internal strategy, the code you're debugging, the draft nobody's seen. Cleaning one up on a website means sending it to that website.
These run in your browser. Nothing is uploaded, nothing is logged, and there's no account to have a data-retention policy. For a file whose entire purpose is to hold your thinking before you're ready to share it, that's not a nice-to-have.
Frequently asked questions about Prompt Formatter & Cleaner
What invisible characters does Clean strip?
Zero-width spaces (U+200B), zero-width non-joiner (U+200C), zero-width joiner (U+200D), left-to-right and right-to-left marks (U+200E, U+200F), the BOM (U+FEFF), soft hyphens (U+00AD), and the bidirectional isolate / embed range (U+2066-U+2069). All of them are invisible in normal rendering but present in the byte stream.
What does JSON Escape do exactly?
It converts your text into the *body* of a JSON string — escaped quotes, backslashes, newlines, tabs and control characters. The output does NOT include the surrounding quotes, so you can paste it directly between the quotes of an existing JSON string field.
Why would my prompt have invisible characters?
Many sources inject them. ChatGPT's web UI sometimes embeds zero-width joiners. Word / Google Docs add non-breaking spaces. Copy-paste from PDFs often includes BOM markers. Most are harmless; some bloat your token count or trigger downstream sanitisation.
Does Format change my actual content?
Only if you opt into 'straighten quotes' (which converts U+201C/D to ASCII " and U+2018/9 to ASCII '). The other Format options only adjust whitespace and line endings — your words are never altered.
Privacy, offline use, browser support, and pricing questions are answered on the site-wide FAQ.