Prompt formatter
Clean up whitespace and wrap prompt sections in XML or Markdown.
Runs in this tab. The file stays here.
Lines like "Context:" or "# Rules" start a new section.
This runs in your browser. Nothing is uploaded.
About Prompt formatter
Clean stray whitespace out of a prompt, and optionally wrap its labelled sections in XML tags or Markdown headings. Runs in your browser.
A prompt pasted out of a document, a chat, or an email tends to come with trailing spaces, Windows line endings, and runs of blank lines. The first option, clean whitespace only, fixes those and nothing else: line endings are normalised, trailing spaces trimmed, three or more blank lines squashed to one, and the ends of the whole text trimmed. A note under the boxes tells you how many characters that removed.
The other two options go further and split the text into sections. A line counts as a section heading if it is a short label ending in a colon, such as "Context:" or "Examples:", or a Markdown heading that starts with #. Everything beneath it becomes that section's body. Text before the first heading goes under "instructions". Then each section is wrapped as either an XML tag, with the label lower-cased and joined with underscores, or a Markdown "##" heading.
That detection is a simple pattern, not an understanding of your prompt. A line like "Note:" in the middle of an example will start a new section, and a long label or a label with a sentence after the colon won't be detected. Check the right-hand box before you copy it. The tool never changes your wording, and whether a different structure helps a given model is something you can only find out by trying.
How to use Prompt formatter
- 1Paste your prompt.
- 2Pick Clean whitespace only, Wrap sections in XML, or Wrap sections in Markdown.
- 3Check that the sections were split where you expected.
- 4Copy the formatted prompt.
What it won't do
- Section detection is a simple pattern: short "Label:" lines and # headings only.
- Text before the first heading goes into an "instructions" section.
- Doesn't rewrite, shorten, or check the prompt.
Common questions
Does it rewrite my prompt?
No. It changes whitespace and adds wrappers around sections. Your words are untouched.
What counts as a section?
A line that is only a short label followed by a colon ("Context:"), or a Markdown heading ("# Rules"). Labels longer than about forty characters, or lines with text after the colon, aren't treated as headings.
Why did it start a new section in the middle of my text?
Because a line like "Example:" on its own looks exactly like a heading. Rename it, add text after the colon, or use the whitespace-only option.
Related tools
Why this one doesn't upload your file
There is no server to upload to. This page is a static file, and the work happens in your browser using the same graphics and WebAssembly code that renders every other site you visit. Your file is read from disk into memory, processed, and handed back as a download. Once the page has loaded you can disconnect from the network entirely and it keeps working. The longer explanation