> ## Documentation Index
> Fetch the complete documentation index at: https://developers.deepl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HTML handling

> Learn how to translate HTML content with the DeepL API.

<Info>
  We've released an **improved version** of XML and HTML tag handling. Check it out [here](/docs/xml-and-html-handling/tag-handling-v2)!
</Info>

By default, the translation engine does not take HTML tags into account. By setting the `tag_handling` parameter to `html`, the API will process HTML input by extracting the text out of the structure, splitting it into individual sentences, translating them, and placing them back into the HTML structure.

<Info>
  For the translation of (non-HTML) XML content please see [XML Handling](/docs/xml-and-html-handling/xml)
</Info>

### Splitting of newlines

The default value for the `split_sentences` parameter for all requests where `tag_handling=html` is `nonewlines`, meaning the translation engine splits on punctuation only, ignoring newlines.

The default value `split_sentences` for text translations where `tag_handling` is not set to `html` is `1`, meaning the translation engine splits on punctuation and on newlines.

Please note that for next-gen models, the parameter `split_sentences`passed by the user is ignored and a value of `nonewlines`is used for maximum translation quality.

### Disable translation of elements

To prevent the translation of elements in the HTML structure, the translation engine respects the `translate="no"` and `class="notranslate"` attributes. In the following example, the `translate="no"` attribute is used to prevent translation of the paragraph:

<Card title="Disable translation of elements example">
  ```markup Example request theme={null}
  <!DOCTYPE html>
  <html>
    <body>
      <h1>My First Heading</h1>
      <p translate="no">My first paragraph.</p>
    </body>
  </html>
  ```

  ```markup Example response theme={null}
  <!DOCTYPE html>
  <html>
    <body>
      <h1>Meine erste Überschrift</h1>
      <p translate="no">My first paragraph.</p>
    </body>
  </html>
  ```
</Card>
