HTML file translator
Translate HTML Files to Another Language
Upload an .html or .htm file, choose the languages, and download the same page in English, Spanish or any of 100+ other languages. Headings, paragraphs, buttons, alt text, the page title and the meta description are translated; tags, CSS, JavaScript and links stay exactly as they were. You can preview the first part of the translation for free before you pay.
or drag and drop
HTML files (.html, .htm) up to 50 MB, or a ZIP up to 200 MB
- Free preview
- From $2.90
- No subscription required
- 100+ languages
No sign-up needed for the preview. This tool translates the text on a page into another language; it doesn’t convert text to HTML or HTML to plain text.
Example: a German HTML page translated to English
In this test, the page title, the meta description, the heading, the button, the alt text and the placeholder came back in English, while every tag, class and link, the code element and the script stayed exactly the same.
We wrote a short German pricing page and uploaded it with German as the source language, English as the target and Pro selected. The file is so short that the free preview translated all of it. Below are our original file and the sample file we downloaded from the preview page, unedited.
Original (German)
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Preise</title>
<meta name="description" content="Tarife für kleine Teams">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="hero">Unsere Preise</h1>
<p>Monatlich <strong>kündbar</strong>.</p>
<img src="team.jpg" alt="Unser Team im Büro">
<input type="email" name="email" placeholder="Ihre E-Mail">
<button type="submit">Jetzt starten</button>
<p>Gutschein: <code>START10</code></p>
<script>track("pricing_view");</script>
</body>
</html>Translated (English), from the free preview
<!DOCTYPE html><html lang="de"><head>
<meta charset="utf-8"/>
<title>Prices</title>
<meta name="description" content="Plans for small teams"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<h1 class="hero">Our prices</h1>
<p>Monthly <strong>cancellable</strong>.</p>
<img src="team.jpg" alt="Our team in the office"/>
<input type="email" name="email" placeholder="Your email"/>
<button type="submit">Get started</button>
<p>Voucher: <code>START10</code></p>
<script>track("pricing_view");</script>
</body></html>- Unchanged:
class="hero", thehrefandsrcURLs, the input’stypeandname,START10inside<code>and the tracking script. - Split by a tag: “Monatlich
<strong>kündbar</strong>.” was translated in two pieces, so it kept the German word order and came out as “Monthly cancellable.” A natural English line would be “Cancel any month.” Check sentences like this in the preview. - Still marked as German:
<html lang="de">was not changed. Set it tolang="en"yourself. - Rewritten as standard HTML: the doctype and
<html>tag now share a line, and<meta>,<link>,<img>and<input>end in/>. The page looks the same in a browser.
What gets translated in an HTML file, and what stays the same
Doc2Lang translates the text people see, plus a few attributes that hold text, such as alt and placeholder; markup, code and URLs are copied to the translated file unchanged.
| Part of the file | Translated? | What happens |
|---|---|---|
| Visible text: headings, paragraphs, lists, tables, links, buttons and form options | Yes | Translated in page order. Identical text is translated once, so a menu label that repeats comes out the same everywhere. |
| The page title (<title>) | Yes | Translated like the rest of the text. |
| Meta description and keywords, Open Graph and Twitter titles and descriptions | Yes | Other meta tags, such as viewport and robots, stay as they are. |
| alt, title, placeholder, aria-label and aria-description | Yes | These attributes are translated wherever they appear. |
| The value attribute on buttons and input fields | Yes | This includes hidden form fields, so check forms after translation. |
| Contents of script, style, code, kbd, samp and var tags, plus SVG and MathML | No | Copied unchanged, including JSON-LD and text inside JavaScript strings. |
| Tag names, class, id, href, src, data-* attributes, inline styles and event attributes such as onclick | No | Copied unchanged. |
| Text that is only numbers, symbols or a URL | No | Copied unchanged. |
| HTML comments | No | Copied unchanged. |
| The lang and dir attributes and <meta charset> | No | Not updated for the new language. Change them yourself (see the checklist below). |
Doc2Lang writes the translated file out as standard HTML: attribute values get double quotes, tags without a closing tag, such as <img>, end in />, optional tags the browser adds anyway, such as <tbody>, are written out, and character codes (entities) such as © become the © character. The page looks the same in a browser, but if you compare it line by line with your original, you’ll see these changes. The translated file is saved with UTF-8 encoding.
How to translate an HTML file
Upload the .html file, choose the source and target languages, and click “Get free preview” to see the first part translated and the price. After you pay, download the translated .html file. There’s nothing to install.
- 1
Upload the HTML file
Drag an .html or .htm file (up to 50 MB) into the box at the top of this page, or click “Upload a file”. Upload just the HTML file; you don’t need to upload the images, CSS or JavaScript files it links to. For a folder of pages, put them in a ZIP (up to 200 MB) and pick the files from the list; each file gets its own preview and price.
- 2
Choose the languages
Pick the language the page is written in and the language you want (100+ are available), then choose Pro or Lite. Under “More settings (optional)”, you can add a glossary so product names and key terms are translated the same way on every page. Then click “Get free preview”.
- 3
Check the preview, then pay and download
The preview shows each piece of text next to its translation, and you can download it as a sample file. If it reads well, pay per file or with credits and download the translated .html file. Put it in the same folder as the original so relative links to images and stylesheets still work.
How much does it cost to translate an HTML file?
Translating a full HTML file starts at $2.90 (32 credits) with Lite or $5 (55 credits) with Pro, and the preview is free. The price depends on how much text there is to translate, not on file size. You’ll see the exact price on the preview page after you upload.
- Tags, CSS, scripts and URLs aren’t counted, so a page full of markup costs no more than its text.
- Text that appears more than once, such as a menu repeated in several places, is still counted each time.
- Lite costs up to 80% less than Pro, and you can switch between them on the preview page before you pay.
- No subscription required: pay per file or use credits. After you sign up and verify your email, the free plan adds 50 credits every month, enough to pay for a small file with Lite.
What to check after translating an HTML file
Open the translated file in a browser and check what Doc2Lang leaves to you: the lang attribute, the text direction, sentences split by tags and the character encoding.
- The lang attribute (the page’s language label):
<html lang="de">isn’t changed. Set it to the new language, such aslang="en", so screen readers, browsers and search engines treat the page as English. - Right-to-left languages: For Arabic, Hebrew or Persian, add
dir="rtl"to the<html>tag. Doc2Lang doesn’t changediror your CSS. - Sentences split by tags: A sentence with a link or a bold word in the middle is translated in pieces, so words can’t move from one side of the tag to the other. The example above shows one. Check these sentences in the preview.
- Character encoding: The translated file is saved as UTF-8, but
<meta charset>keeps its original value. If your page declares another encoding, such as<meta charset="windows-1252">, the file displays correctly when you open it from the Doc2Lang download link, but once it’s saved to your computer or put on your own server, the browser reads it with the old encoding and may show garbled text. Change the tag to<meta charset="utf-8">. - Longer text: A translation can run longer than the original (English to German, for example), so check fixed-width buttons and menus.
- Template variables: Template variables such as
{{ name }}inside the text are sent for translation along with it; check that they come back unchanged. - Forms: The value of every input field is translated, including hidden ones, so check that forms still submit the values your server expects.
Can you translate an HTML file with Google Translate, Chrome or DeepL?
Not as a file with Google Translate or Chrome: Google Translate’s Documents tab doesn’t accept HTML files, and Chrome translates a page only while you’re viewing it. DeepL translates HTML files after you log in to a DeepL Pro or DeepL API account.
Google Translate
Google Translate’s Documents tab accepts .docx, .pdf, .pptx and .xlsx files up to 10 MB, and its Websites tab translates a public page from its URL for you to view (Google Translate Help, checked November 25, 2026).
Chrome’s Translate option
Chrome translates the page you’re looking at in the browser (Google Chrome Help, checked November 25, 2026). Your .html file doesn’t change, so this helps you read a page rather than publish a translated one.
DeepL
DeepL’s HTML file translation page says you need to log in to a DeepL Pro or DeepL API account and then upload the file under “Translate files” (deepl.com, checked November 25, 2026).
With Doc2Lang, you can upload the file without an account, check the free preview and download a translated .html file you can edit and publish.
HTML file translator FAQ
Is there a free HTML file translator?
Can I translate an HTML file to English?
Can Doc2Lang translate a whole website from its URL?
Does Doc2Lang convert text to HTML, or HTML to plain text?
Is text inside JavaScript translated?
Can I translate several HTML files at once?
How long are my files stored?
More file translators
Several HTML files, e-books and Word documents.
Translate your HTML file
Upload an .html or .htm file and check the free preview. No sign-up needed.