Tools

Prompt template filler

Fill {{variables}} in a prompt template from JSON and see the exact prompt the model will get, with what was missing and what went unused.

Runs in your browserAI developer tools25.1K
Free

Input

0 B

Result

The result will appear here.

Prompts in real applications are templates: a system message with {{product.name}} here and {{history}} there, filled in by code at request time. When the answer comes back wrong, the first question is what the model actually received. Paste the template, put the values in the variables box as a JSON object, and this tool renders the prompt the way promptfoo (promptfoo/promptfoo, MIT) and every Mustache-style engine would, lists any variable that was never filled, and counts the result's tokens, so you can test a template before it reaches production.

How it works

  • {{ name }} and dotted paths such as {{ user.name }} or {{ items.0 }} are filled; spaces inside the braces are optional.
  • A string is inserted as it is, a list of plain values becomes one line per item, an object or a list of objects is inserted as indented JSON, and null becomes an empty string.
  • A variable with no value is left in place and named in the stats, and so is every top-level key in the JSON that the template never used.
  • Jinja and Nunjucks logic — {% if %}, {% for %} and filters like {{ name | upper }} — is listed as not executed and left untouched, so the output is never a guess.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Which template syntax does it support?
The part every engine agrees on: double-brace variables with dotted paths. That covers Mustache, Handlebars, promptfoo, LangChain's mustache format, and simple Jinja2 and Nunjucks templates. Loops, conditions, filters and includes are not run; they are reported so you can see which parts of the template need the real engine.
How do I pass a list of earlier messages or search results?
Give the variable a JSON array. An array of strings is written one item per line, which suits a list of ticket titles or retrieved passages; an array of objects is written as pretty-printed JSON, which models read reliably. For a numbered list, number the strings yourself.
Why keep missing variables in the output instead of blanking them?
A blank is invisible: the model gets "Sign off as ." and nobody notices. A leftover {{agent_name}} is obvious in the preview and in the model's answer, and the stats list it by name. Set the variable to an empty string if you really want it empty.

The open-source behind it

This tool is a self-contained implementation. promptfoo/promptfoo (MIT) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.

promptfoo/promptfoo

Also known as

  • prompt template
  • prompt variables
  • fill prompt template
  • mustache prompt
  • jinja prompt template
  • prompt engineering tool