String template filler
What is a String Template Filler?
Template filling replaces placeholders such as {{name}} in a text with values from a data object. It is how personalised emails, notification messages, configuration files and documents are generated from one template. This tool lets you test a template against JSON data instantly, without writing code.
How to use it
- Write or paste a template with placeholders in double curly braces.
- Provide the data as JSON, with keys matching the placeholder names.
- Copy the filled result.
Example
Template:
Hi {{name}}, your order #{{order.id}} of {{order.total}} has shipped to {{city}}.Data (as JSON with double quotes):
{ name: 'Asha', city: 'Pune', order: { id: 1042, total: '₹2,499' } }Result: Hi Asha, your order #1042 of ₹2,499 has shipped to Pune. Dot notation such as order.id reads nested values.
Things to watch
- Missing keys: a placeholder without data is left empty or unchanged, depending on the setting. Always check the output for gaps such as Hi ,.
- Exact names: placeholders are case-sensitive;
{{Name}}and{{name}}are different. - Escaping: when the result is used as HTML, user-supplied values must be HTML-escaped to prevent injection. Template engines like Mustache and Handlebars escape by default with double braces.
In code
Mustache, Handlebars, Jinja2 (Python), Liquid (Shopify) and Go's text/template use similar syntax with extra features such as loops and conditionals. Use this tool for quick previews and simple substitutions.
Frequently Asked Questions
What placeholder syntax is supported?
Mustache-style double curly braces such as {{name}}, with dot notation for nested values such as {{order.id}}.
What happens if data for a placeholder is missing?
The placeholder is left empty or unchanged. Check the output for missing values before using it.
Are placeholder names case-sensitive?
Yes. The placeholder name must match the JSON key exactly.
Is it safe to insert user data into HTML templates?
Only if values are HTML-escaped. Otherwise users could inject markup or scripts.