Template String with Values

Fill {{placeholders}} / ${vars} in a template from JSON values.

The Template String with Values tool fills a template with data from a JSON object. It recognises {{key}} and ${key} placeholders, supports nested paths such as user.name and array indexes, and tells you which keys were missing. Use it to preview messages, email text and log formats.

What is a template string?

A template is text with named holes that are filled from data. Mustache and Handlebars style templates use double curly braces, while JavaScript template literals use a dollar sign and braces. Rendering means looking up each name in a set of values and substituting it. Names can be paths: user.name reads the name property of the user object, and items[0] reads the first array element. Previewing a template against real values is helpful when writing notification text, emails, prompts or log lines, because mistakes such as a misspelled key are obvious. This tool is a simple substitution engine, not a full template language. It has no loops, conditions or helpers, and it never evaluates JavaScript. Values are inserted as plain text.

How to use Template String with Values

  1. Write the template Type your text with {{key}} or ${key} placeholders in the Template box.
  2. Provide values Enter a JSON object in the Values (JSON) box.
  3. Read the output The Rendered output box updates immediately.
  4. Fix missing keys If a warning lists Missing keys left unchanged, correct the key names or add the values.

Frequently asked questions

Does it support loops or conditionals?

No. It only substitutes values. For loops and conditions use a template engine such as Handlebars or Jinja.

Can I run JavaScript inside ${...}?

No. The text inside the braces is only used as a key to look up, never executed.

Does it escape HTML in the values?

No. Values are inserted as text without escaping. If you render the result as HTML, escape the values first.

How are array indexes written?

Use items[0] or items.0. Both read the first element.

Is my data sent anywhere?

No. Rendering happens in the page and your template and values stay on your device.