Skip to content
UniKit

Text template

Fill text templates with {{name}} or ${name} placeholders: default values, three policies for unmatched variables, one set of variables per line, optional {{#each}} loops, plus a report of used, unused and missing variables.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Template and variables

Placeholders can be written as {{name}} or ${name}, defaults as {{name|fallback}}. Loops are off by default: inside a loop {{.}} is the current item and the list is split on commas or newlines.

Placeholder syntax
Unmatched variables

Rendered result

Fill in a template and some variables to see the result.

What this tool does

  • Turn one template into dozens of messages: invitations, notifications or release notes where only a couple of fields change, one set of variables per line.
  • Hand a fill-in-the-blank template to teammates who do not code — they only edit a "key=value" list and press render.
  • Draft config or API snippets with {{host}} and {{token}} placeholders, then swap in the test environment values in one pass.
  • Debug a template: the report lists which variables were used, which were never referenced and which are still missing.

Example

Input

Template: Hello {{name}}, you are in {{city}}.
Variables: name=Ada

Output

Hello Ada, you are in {{city}}.

The default policy is "keep as-is", so the missing city placeholder stays in the output and is reported under unmatched variables.

Frequently asked questions

What is the difference between {{name}} and ${name}?

Only the syntax: both behave identically and you switch between them with the placeholder syntax control. Use {{name}} for plain prose such as emails, and ${name} when the template itself lives inside a JavaScript template literal. Do not mix the two — the renderer only recognises one syntax at a time.

What happens when a variable has no value?

By default the placeholder is kept as-is and listed under unmatched variables, which makes missing data obvious. You can also blank it out, or mark it as [[name]] so you can jump straight to the gap in a long document.

How do default values work?

Write the variable name, a pipe and the fallback, for example {{city|Berlin}}. The fallback is only used when the variable is absent from the table; if you wrote city= with an empty value the tool treats that as an explicit empty string and does not fall back.

How do the loops work?

Enable the loop option and write {{#each tags}}<{{.}}>{{/each}}. The list variable is split on commas, semicolons or newlines, and {{.}} is the current item inside the body. Loops do not nest and are off by default so that a literal {{#each}} in ordinary text is never parsed.

Is my template uploaded anywhere?

No. Parsing and substitution happen entirely in your browser, the page makes no network requests, and a refresh clears the inputs. Internal copy and test tokens are safe to paste.

Keywords:text templatetemplate fillplaceholder replace批量文本生成模板填充变量替换{{变量}}mass text generation字符串占位符默认值语法

Related tools