> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.templated.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 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](https://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](https://templated.io/tools/convert-html-to-jpg/) and [HTML to PDF](https://templated.io/tools/convert-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:

```json
{
  "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.