Convert Chinese HTML Pages

Need a Traditional or Simplified version of a static page, a help page or an email template? Drop in the .html file. The text on the page and its descriptions are converted, while tags and scripts stay as they were.

Direction
Standard
Engine not loaded yet
File name
BOM
A marker at the start of a UTF-8 file. Auto: added to CSV (Excel needs it); other formats follow the original file.
Advanced options by format

Drop files here, or click to choose

Subtitles, lyrics, documents and data files; you can pick several at once. Only the text is converted: timings, tags and structure stay as they are.

.txt .srt .ass .ssa .vtt .lrc .md .markdown .json .csv .html .htm

Text and files are processed in your browser and never uploaded.

HTML is the source of a web page. The text sits between tags, and the tags carry attributes with links, image addresses, class names and scripts. Converting the whole file as plain text would also change Chinese paths in href, class names and strings in JavaScript, breaking links, styles and scripts. This page splits the file into tags and text by the rules of HTML, replaces only the text people read in place, and keeps every other byte, so nothing is reformatted.

What is converted

  • Text between tags, including the <title>.
  • The title, alt, placeholder and aria-label attributes.
  • The content of <meta> tags for description, keywords, og:title and og:description.
  • Chinese written as numeric character references such as &#22836;, which are written back the same way after converting.

What stays the same

  • Tags and all other attributes, such as href, src, class and id. In the examples below, the image path 图片/头像.png keeps its Simplified characters while the alt text becomes 頭像.
  • Scripts and styles: the contents of <script> and <style>, and HTML comments.
  • Code: text inside <pre>, <code>, <kbd> and <samp>.

Encoding and garbled pages

Older pages often declare their encoding with <meta charset="gbk">. The output is UTF-8, and if the declaration stayed, the browser would still decode the page as GBK and show mojibake. So <meta charset> and the encoding in an XML declaration are changed to utf-8. A Chinese <html lang> is set to the target language by default, for example zh-Hant-TW, and you can turn that off with “HTML: set <html lang> to the target language” under Advanced options by format.

Conversion examples

OriginalResult
<title>软件下载</title><title>軟件下載</title>
<p>他把<b>头</b>发剪短了。</p><p>他把<b>頭</b>髮剪短了。</p>
<img src="图片/头像.png" alt="头像"><img src="图片/头像.png" alt="頭像">
<a href="/分类/软件" title="软件">软件下载</a><a href="/分类/软件" title="軟件">軟件下載</a>
<p>运行 <code>安装程序.exe</code> 即可。</p><p>運行 <code>安装程序.exe</code> 即可。</p>
<meta charset="gbk"><meta charset="utf-8">

Real output from OpenCC (s2t).

How to use

  1. Drop .html or .htm files onto the page, or click Choose files. All the pages of a small site can be selected at once.
  2. Choose the direction and standard. For readers in Taiwan, choose Taiwan and keep Convert regional terms on.
  3. Read the warnings on the card. A changed charset or an irregular structure is listed there.
  4. Download the files and open them in a browser to check them.

Things to check

  • For pages that link to each other, choose Keep name under File name. Link addresses are not changed, so files renamed with a language code would no longer match the links.
  • Text inside JavaScript is not converted. If your scripts load their interface text from a separate JSON file, drop that file in too and convert it with the same settings.
  • With Convert regional terms on, wording on the page is replaced with local terms. 点击 (click), for example, becomes 點選 under the Taiwan standard. Read the pages through before publishing.

FAQ

Will JavaScript and CSS break?

No. The contents of <script> and <style>, HTML comments, and attributes such as class and id are kept exactly as they were.

Do Chinese URLs in links change?

No. Addresses in href, src and other attributes stay as they are, so a link such as /分类/软件 keeps working.

Why was the charset changed to utf-8?

The downloaded file is UTF-8. If the page still declared gbk or big5, the browser would decode it with the old encoding and show gibberish, so the declaration is changed to utf-8 and the card tells you, for example “charset changed from gbk to utf-8”.

Can I enter a URL and convert a whole website?

No. The converter does not fetch web pages. Save the pages as .html files first, then drop them in.

Are code samples on the page converted?

No. Text inside <pre>, <code>, <kbd> and <samp> stays as it is.