Articles on: Templates and Layers

Convert HTML to an Image

Templated can turn HTML code into an image in three ways.


1. Free online tool (no account needed)


Paste your HTML (and optional CSS) at templated.io/tools/convert-html-to-image and download it as PNG or JPG. The conversion runs in your browser. There are also tools for HTML to JPG and HTML to PDF.


2. HTML layer in a template, rendered with the API


Add an HTML layer to a template in the editor (HTML in the sidebar). Then send your HTML in the render request with the layer's html property:


{
  "template": "YOUR_TEMPLATE_ID",
  "format": "png",
  "layers": {
    "html-1": { "html": "<div style='font-size: 48px'>Hello <b>world</b></div>" }
  }
}


Use your layer's name in place of html-1. See "HTML Layers" for the supported HTML and CSS.


3. Import a full HTML page as a template


In the dashboard, click Create Template, open More > HTML and paste your HTML. Templated turns it into a template that you can edit in the editor and render with the API.


Things to know


  • Images inside the HTML must use full public URLs (https://...). Local paths like portrait.jpg don't load, so the image comes out blank.
  • JavaScript is not executed.

Updated on: 30/10/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!