Convert text to HTML with every line and space kept
Turn a text file into an HTML file online. No account needed.
or drop your TXT anywhere on this page
TXT → HTML
What you get from a .txt file
To convert text to HTML here, select or drop a saved .txt file, press Convert to HTML and download the page. It is one step on our server, graded Exact: nothing is reworded, reflowed or tidied. The page keeps your file's name, so notes.txt comes back as notes.html, and it opens in any web browser and edits in any text editor.
This text to HTML converter works on files, not on typed text: there is no box to paste into. It suits notes, logs, READMEs and drafts you want to read in a browser, share as a web page or put on a site exactly as they were written.
- Your whole text sits in one block of preformatted text (the HTML pre element), so the browser shows it line for line, as typed.
- Line breaks, blank lines, indents and runs of spaces stay where they were, so columns lined up with spaces still line up.
- The words are set in a fixed-width font at 10 pt: Liberation Mono where the reader has it, otherwise the browser's own fixed-width font.
- The browser tab shows your file name as the page title: notes.txt gives a page called notes, and a name such as Résumé draft keeps its accent and space.
How to convert TXT to HTML
- 1Select or drop your text file
Nothing uploads until you press convert.
- 2Choose your options
We show the route and its fidelity grade up front.
- 3Download your HTML file
Then it is deleted after 24 hours, automatically.
Just the words. No fonts, no layout, no arguments.
A document as markup. Opens in a browser, edits in anything.
One step, one tool. Nothing is interpreted on the way.
What stays plain text in the web page
The converter shows what you typed and reads no meaning into it. That matters if you expected headings or links:
- HTML tags typed in the file are shown, not used. A bold tag appears as the characters you typed, and a script tag does not run. If your .txt already holds HTML code, rename it to end in .html instead of converting it.
- Markdown is not read. A line starting with # keeps its #, and an asterisk bullet stays an asterisk.
- A web address stays plain text, not a link you can click.
- Long lines do not wrap. A paragraph typed as one long line stays one line: in our test, a line of 525 characters ran far past the edge of a desktop window, and the reader had to scroll sideways.
Accents and other alphabets
How your letters come out depends on how the .txt was saved (its encoding). Our server first checks whether the file reads as UTF-8; if it does not, it reads it as Western ANSI (Windows-1252), the encoding older Windows editors used for English and Western European languages. The web page itself is always saved as UTF-8 and says so, so browsers read it the right way.
| The .txt was saved as | In the HTML page |
|---|---|
| UTF-8, with a byte order mark (BOM) or without one | Every letter we tried: accents, £ and €, Greek, Cyrillic, Hebrew, Arabic, Chinese, Japanese, Hindi and an emoji |
| Western ANSI (Windows-1252) | é, ü, ñ, £ and € all correct |
| ANSI for Cyrillic (Windows-1251) | Garbled: Привет мир came out as Ïðèâåò ìèð |
| UTF-16, called Unicode in older Notepad | Garbled, with # signs between the letters |
Opening, sharing and publishing the page
The result is a whole web page, not a snippet: a head with the title and a short style block, then your text in the body. Double-click it to open it in your browser, attach it to an email, or upload it to a website as it is. To place the text inside a page you already have, open the .html in a text editor and copy the pre element from the body, opening and closing tags included.
A long file stays one page with no page breaks: in our test, 3,000 lines came back as a single .html file of about 140 KB.
Plain text has no headings, bold or pictures to carry over. When your document has them, start from the file it came from: convert Word to HTML brings its text, tables, links and pictures into the page. To print the words or send them as fixed pages, convert text to PDF. For a document you can format, convert text to Word, or convert text to RTF or convert text to ODT for other word processors. Going the other way, convert HTML to text strips a web page back to its words.
Questions people ask
How do I convert a text file to HTML?
Press Select TXT file, or drop the .txt on this page; nothing uploads until you convert. Then press Convert to HTML and download the .html file. On the free plan you can convert three files a day, each up to 25 MB, one at a time, and our server deletes both files after 24 hours.
Can I type or paste text straight into the page?
No. This page converts a saved .txt file and has no text box. Paste your words into Notepad, or into TextEdit after Format > Make Plain Text, save the file as UTF-8 text with a name ending in .txt, then drop it here.
What HTML does the converter produce?
A complete page saved as UTF-8: a head with the title and a short style block, and a body holding your whole text in one pre element (preformatted text). There are no paragraph or line break tags and no links; the pre element keeps the line breaks and spacing on its own.
Will accents and other alphabets show correctly?
Yes, when the .txt is UTF-8: in our tests accents, the € sign, Greek, Cyrillic, Arabic, Chinese and emoji all came through. A Western ANSI (Windows-1252) file keeps accents such as é and ñ too. A file saved as UTF-16, or as ANSI for another alphabet such as Cyrillic, comes out garbled, so save it as UTF-8 first.
Will the web page have a title?
Yes. The title in the browser tab is your file name without .txt, so notes.txt gives a page called notes. Accents and spaces in the name are kept. To change it, edit the title element near the top of the file in any text editor.
Is converting Text to HTML free?
Yes. Up to 25 MB and three conversions a day are free, with no account. Pro and Business lift the file limit to 100 MB and remove the daily cap.
What happens to my files?
Both your Text and the HTML we produce are deleted 24 hours after each conversion, automatically. Try again and Continue to another tool start a new conversion, with its own 24 hours. Nothing is used for training and no human looks at your documents.
Will the HTML look exactly like the Text?
This pair grades as “Exact”. We show the exact route and that grade before you convert, so there are no surprises about what survives the trip.
Do I need to install anything?
No. Nothing to install. Pick or drop a file here, it's converted on our servers, and you download the result.
How large can my file be?
25 MB on the free plan, and 100 MB on Pro and Business.
Can I convert several files at once?
On Pro and Business, yes: add up to 100 files before converting. The free plan converts one file at a time.