Prompt Template Builder — {{Variables}}, CSV Batches & Batch API JSONL
Write a prompt with {{variables}}, fill it from a form or a CSV, and export one prompt per row as text, CSV, or OpenAI and Anthropic batch files.
Summarize the following article for a busy executive in 3 bullet points. Keep names, numbers and dates exactly as written. If something is unclear in the source, say so instead of guessing. <source> Revenue grew 12% to $4.1M in Q2, driven by the new clinic plan. Churn rose from 2.1% to 2.6% after the price change in April. Hiring is paused until September. </source>
Token counts use OpenAI's o200k tokenizer (GPT-4o and later). Claude, Gemini and Llama use their own tokenizers, so their counts differ somewhat for the same text.
Runs entirely in your browser. Templates and CSV data never leave your device. Browse all free tools.
Found a problem, or something that could be better? We read every message and we fix things quickly.
This prompt template builder lets you write a prompt once with {{variables}} and reuse it for every case. Placeholders become form fields automatically, defaults can live in the template as {{tone|friendly}}, and the filled prompt updates as you type, with a token count. It is the quickest way to keep a tested prompt consistent across a team instead of editing copies by hand.
For bulk work, paste or upload a CSV and get one prompt per row. Columns are matched to variables by name, gaps are flagged, and the result downloads as plain text, JSONL, CSV, or batch files ready for the OpenAI Batch API and Anthropic's Message Batches API, both of which process large jobs asynchronously at a lower price than live requests. The tool prepares requests; it does not call any API, so you still upload the file with your own key.
How to use
- Pick a starter template or write your own prompt, marking each changing part as {{name}}.
- In Fill once mode, type values into the generated fields and copy the finished prompt.
- For many prompts, switch to Batch from CSV, paste or upload a CSV whose column names match your variables, and check the matching line.
- Choose an export format. For batch APIs, set the model, max output tokens and an optional system prompt.
- Download the file and upload it to the provider (OpenAI Files API with purpose batch, or POST the Anthropic JSON to /v1/messages/batches).
Frequently asked questions
What is a prompt template?
A prompt template is a prompt with placeholders for the parts that change, such as the text to summarize, the audience or the tone. You test the wording once, then fill the placeholders for each case. It keeps results consistent, makes prompts easy to share, and is how prompts are stored in most LLM applications and frameworks.
How do I create a JSONL file for the OpenAI Batch API?
Each line must be a JSON object with custom_id, method (POST), url (for example /v1/chat/completions) and body, where body is the normal request with model and messages. Put your prompt in a template, load a CSV, choose OpenAI Batch API and download. Upload the file with purpose "batch", then create a batch with the same endpoint; results come back keyed by custom_id.
What format does Anthropic's Message Batches API use?
POST /v1/messages/batches takes a JSON body with a requests array. Each request has a custom_id (letters, digits, hyphens and underscores, up to 64 characters) and params, which holds a normal Messages API request: model, max_tokens and messages, plus an optional system prompt. The Anthropic export writes that body directly, or one request per line for scripts.
How are CSV columns matched to variables?
By name, ignoring case, spaces, dashes and underscores, so a column called "Product Name" fills {{product_name}}. A variable with no column uses its default ({{tone|friendly}}) or the value you typed in Fill once mode. The tool shows which variables matched and lists any rows that still have unfilled placeholders before you export.
How accurate is the token count?
It uses OpenAI's o200k_base tokenizer, the one used by GPT-4o and later OpenAI models, so counts for those models are exact for the prompt text. Chat formatting adds a few tokens per message on top. Claude, Gemini and Llama use different tokenizers and will give somewhat different numbers for the same text, so treat the count as an estimate there.
Template syntax
• {{name}}: a variable. Names start with a letter or underscore and can contain letters, digits, _, - and dots. Spaces inside the braces are ignored, so {{ name }} works.
• {{name|default text}}: a variable with a default used when no value is given.
• The same variable can appear several times; it is filled everywhere with the same value.
• Unfilled variables stay as {{name}} in the output and are reported, so a missing column does not silently produce a broken prompt.
Wrap long inputs in clear delimiters such as <source>…</source> or triple quotes. It tells the model where your instructions end and the data begins, and makes prompt injection inside the data less effective.
Batch APIs: when they are worth it
OpenAI and Anthropic both offer batch processing at a 50% discount on token prices, in exchange for asynchronous results: jobs finish within 24 hours and often much sooner. That suits work where nobody is waiting on the answer, such as classifying support tickets, generating product descriptions, summarizing documents or running evaluations.
Match results by custom_id, not by line order, because results can return in any order. Keep the CSV that produced the batch: the row-1, row-2 IDs in the export map straight back to its rows. Run a handful of rows as live requests first, since a template mistake in a 10,000-row batch is an expensive way to find it.
Related free tools
- Token Counter — Count tokens exactly for OpenAI models, estimate them for Claude, Gemini and Llama, see the cost, and watch the text split into tokens.
- LLM API Cost Calculator — Compare the cost of your workload across 40+ models, with caching, batch discounts, long-context tiers and reasoning tokens. Prices sourced and dated.
- Midjourney Prompt Generator — Build Midjourney prompts from style, lighting and camera chips with correct V8/V7 parameters, or switch to Stable Diffusion and Flux.
- MCP Config Generator — Define an MCP server once and get the exact config file or command for Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and Codex.
- Word Counter — Count words, characters, sentences and reading time, and check X, LinkedIn, Instagram, YouTube, SEO and SMS limits as you type.