Structured Prompt Builder
Build a Claude-style structured prompt from labelled sections — wrap each in XML tags, Markdown headings or hash delimiters. Free, runs in your browser.
Structured Prompt Builder
How to Use the Structured Prompt Builder
Name your sections
Give each block a short, descriptive name — instructions, context, examples, document. The name becomes the label the model reads, so keep it plain and lowercase.
Add the content
Paste or type the content for each section — your task steps, the source document, a few examples. Use Add section for as many blocks as you need, and remove any you don't.
Pick a format
Choose XML tags (Claude's favourite), Markdown headings, or hash delimiters. The output rebuilds live in the format you select — blank sections are skipped automatically.
Copy and paste
Hit Copy and drop the structured prompt into Claude, ChatGPT, or your agent's message. It all builds in your browser — nothing is sent anywhere.
Structure Is How You Talk to a Model Clearly
Why structured prompts beat a wall of text
When you paste a long instruction, a document, and a few examples into one undifferentiated paragraph, the model has to guess where one part ends and the next begins. Is that sentence an instruction, or part of the document you want summarised? Structured prompting removes that guesswork. By wrapping each part of your prompt in a labelled section — instructions, context, examples, document — you give the model unambiguous boundaries. It knows exactly which text is the task and which text is the material to act on. The result is fewer misreadings, more reliable formatting, and answers that stay on the rails even when your inputs get long.
Anthropic's own guidance for Claude recommends XML-style tags for this exact reason. A block like <document> … </document> is trivial for a model to spot and trivial for you to reference later ("summarise the text inside the document tags"). XML tags are not magic syntax — the model is not parsing them as code — but they are a strong, visually distinct delimiter that large language models have seen countless times in training. Markdown headings (## Section) and hash delimiters (### SECTION ###) work the same way: they are signposts. This builder lets you author once and switch the delimiter style with a single dropdown, so you can match whatever convention your model or team prefers without retyping a thing.
"A model can only follow the structure it can see. Delimiters turn a blurry paragraph into a labelled map — task here, data there, examples over there."
When delimiters matter most
Delimiters earn their keep the moment your prompt mixes instructions with data. Summarising a contract, extracting fields from an email, rewriting a transcript, grading an essay against a rubric — in every one of these tasks you are handing the model two different kinds of text and asking it to treat them differently. Without separation, models routinely "leak": they follow an instruction that was actually buried inside the document, or they summarise your instructions instead of your data. Wrapping the source in a <document> tag and the task in an <instructions> tag makes that confusion almost disappear, and it also hardens your prompt against accidental prompt injection from untrusted content.
Structure also makes prompts maintainable. Because each section is self-contained, you can tweak one block — tighten the instructions, swap in a new document, add an examples section — without rewriting the whole thing. You can reference sections by name in your instructions ("use the tone shown in examples"), and you can reuse the same skeleton across dozens of tasks by just changing the contents. That is the same discipline good engineers apply to code: small, named, single-purpose blocks beat one giant function every time. Whether you favour XML tags, Markdown headings, or hash delimiters, the principle is identical — label the parts, separate the concerns, and let the model spend its attention on the task instead of on figuring out what you meant. Fill the sections, choose a format, copy the result, and paste it into Claude, ChatGPT, Gemini, or any agent: structured plain text travels everywhere.
10 Facts About Structured Prompts
Anthropic recommends XML tags like <document> to clearly separate parts of a Claude prompt.
Delimiters tell the model which text is the task and which is the data to act on.
Wrapping untrusted content in a tag hardens a prompt against accidental prompt injection.
You can reference a section by name later — "summarise the text in the document tags".
The tags aren't parsed as code — they're just a strong, visually distinct signpost the model has seen often.
Markdown headings (## Section) and hash delimiters work the same way as XML tags.
Structure makes prompts maintainable — change one block without rewriting the whole thing.
Lowercasing and slugifying a tag name (spaces → underscores) keeps it valid and predictable.
Separation cuts a common failure: the model "leaking" and following an instruction hidden in the data.
This builder runs entirely in your browser — your prompt is never uploaded.
Frequently Asked Questions
- A structured prompt splits your request into clearly labelled sections — such as instructions, context, examples and document — instead of one undifferentiated paragraph. Each section is wrapped in a delimiter (XML tags, Markdown headings, or hash markers) so the model can tell exactly which text is the task and which is the data to act on.
- Anthropic's prompt guidance recommends XML-style tags like
<document>…</document>because they are a strong, visually distinct delimiter the model has seen widely in training. They make boundaries unambiguous and let you reference a section by name in your instructions. The model doesn't parse them as code — they're simply a reliable signpost. - Whenever your prompt mixes instructions with data — summarising a document, extracting fields, rewriting a transcript, grading against a rubric. Separating the task from the material it operates on stops the model from confusing the two and reduces "leaking", where it follows an instruction buried inside your data.
- XML tags wrap content as
<section> … </section>; Markdown uses a## Sectionheading above the content; hash delimiters use### SECTION ###. All three serve the same purpose — clear separation. XML is best for Claude and for content you'll reference by name; Markdown reads cleanly; hash delimiters stand out strongly in plain text. - The section name you type is lowercased and slugified: spaces become underscores and any character outside
a–z,0–9or_is stripped. So "Source Document" becomes<source_document>. This keeps every tag valid and predictable. - No. The prompt is assembled entirely in your browser with plain JavaScript. Nothing you type is sent to any model, server, or third party, and nothing is saved.
- No — any section missing either a name or content is skipped automatically. You can leave extra rows empty as you draft without cluttering the assembled prompt.
- Yes — delimiters are vendor-neutral plain text. XML tags, Markdown headings and hash markers all work on ChatGPT, Gemini and most agent frameworks. XML is most strongly associated with Claude, but every major model benefits from clearly separated sections.
- They help. Wrapping untrusted content in a clearly named tag — and telling the model the text inside is data, not commands — makes it less likely to obey instructions hidden in that content. It's not a complete defence, but clear separation is a meaningful first layer.
- Completely free, with no account or sign-up, and no limit on use. It runs in your browser and collects no data.
Related News
You may be interested in these recent stories from our newsroom.
No related news yet for this tool. Our editorial team publishes new pieces every week.
Browse all news →75 more free tools
Calculators, converters, security tools — no signup.