TXT to HTML Converter

Turn a TXT file or pasted plain text into clean HTML as you type — paragraphs, line breaks, lists and links, with everything escaped properly so it is safe to paste anywhere.

TXT to HTML converter

Convert

Options
Supports: TXTMD

Nothing is uploaded. This tool runs entirely in your browser, so the file never leaves your device. There is no server to send it to, no copy kept anywhere, and it keeps working if you lose your connection after the page has loaded.

Accepts .txt You get: HTML you can copy or download Free, no sign-up

The rules it follows

A blank line starts a new paragraph. Lines inside a block stay together as one paragraph, with a line break between them unless you turn that off. That is the convention nearly every plain-text document already follows, which means most text needs no preparation at all — paste it and it comes out shaped the way it looked.

A block where every line begins with a bullet marker — a hyphen, an asterisk, a bullet character, or a number followed by a dot or a bracket — becomes a list, ordered if the first line was numbered. A block where only some lines look like that stays a paragraph. Guessing halfway is worse than not guessing.

A worked example

Paste a heading line, a blank line, a short paragraph, another blank line, and three lines each beginning with a hyphen. What comes back is a paragraph for the first line, a paragraph for the second block, and a <ul> containing three <li> elements for the third — the shape you could already see in the plain text, expressed as markup.

Add a URL anywhere in that text and it becomes a link, with any full stop that ended the sentence left outside the anchor where it belongs. Add an angle bracket and it comes back as &lt;, visible rather than interpreted. Nothing else changes, which is the point: the converter reads your text's structure rather than imposing one on it.

Escaped first, marked up second

Everything from your input is escaped before any markup is added. Angle brackets, ampersands and quotation marks all come out as visible characters, which means text that looks like a tag stays text and nothing you paste in can become executable code in the page you paste the result into.

Links are made after that escaping, not before, so only a genuine http or https address becomes an anchor and the address itself is already safe. Trailing punctuation is left out of the link — a full stop at the end of a sentence is not part of the URL. Every generated link carries rel="noopener", because a link you did not write should not get a handle on your window.

The four options, and what each one changes

"Keep single line breaks inside a paragraph", on by default, controls what happens to lines inside one block that are not separated by a blank line: on, each line ends with <br> so it stays on its own line; off, the lines are joined with a single space into one running paragraph instead. "Turn bullet and numbered blocks into lists" controls whether a block of marked lines becomes a <ul> or <ol> at all — off, it is treated as an ordinary paragraph, markers and all. "Turn web addresses into links" controls whether a matched URL becomes an <a>; off, it stays plain escaped text. "Complete HTML page" wraps the fragment in a doctype, head and body, covered below.

A common mistake, and what quotes do

Pasting text that already contains HTML — copied from a web page, say — into a tool that does not escape it is how a stray <div> from the source ends up breaking the layout of wherever the result gets pasted. Here that cannot happen: every angle bracket in the input is escaped before anything else runs, so copied markup comes out as visible text describing itself, not as markup taking effect a second time.

Straight quotation marks are escaped too, to &quot;, which matters specifically for an attribute value — a quote inside text that later got dropped into an HTML attribute without escaping could end that attribute early. In an ordinary paragraph a literal " would have rendered fine either way; escaping it here is what keeps the rule simple: every special character is escaped, always, rather than "escaped only where it would currently matter".

Not the same job as CSV to TSV

This turns plain text into HTML markup — paragraphs, breaks, lists, links. It has nothing to do with spreadsheet delimiters; a page for that job, converting between comma- and tab-separated rows, is CSV to TSV. The two only share a family resemblance: both read plain text and produce a different plain-text format from it, following rules that are written down rather than guessed at row by row or line by line. If the goal is structured data rather than markup — splitting lines into fields for a program to read — that's Text to JSON, not this page.

Fragment or full page

By default you get just the paragraphs and lists, which is what you want when pasting into a CMS, a blog editor or an existing template. Nesting a second <html> element inside a page is a reliable way to break it.

Turn on the full-page option and you get a standalone file with a doctype, a charset and a viewport tag — ready to save and open in a browser. The Copy button takes whichever you have chosen.

What it does not do

It does not preserve indentation, because HTML collapses whitespace and keeping it would mean wrapping everything in a <pre> block — a different tool for a different job. It does not interpret Markdown emphasis, headings or tables: this converts the shape of plain text, not a markup language that happens to look like plain text.

No classes or inline styles are added either, so the result inherits whatever your site already looks like instead of fighting it.

Where your text goes

Nowhere. The conversion runs in your browser as you type, which is also why it is instant. This page has no upload endpoint, a file you drop is read on your own device, and nothing is logged or stored.

Frequently asked questions

Can I convert a .txt file directly?

Yes. Drop a .txt file onto the box, or choose it with the file picker, and its text is read in your browser and converted the same way as pasted text. You can then copy the HTML or download it as an .html file. Nothing is uploaded.

What does it do with blank lines?

A blank line separates paragraphs. Lines within a block become one paragraph, with a line break between them unless you turn that off. It is the convention almost every plain-text document already follows, so most text needs no preparation.

Does it recognise bullet lists?

Yes. A block where every line starts with -, *, • or a number followed by a dot or bracket becomes a list — ordered if the first line is numbered, unordered otherwise. A block where only some lines look like that stays a paragraph, because guessing there does more harm than good.

Is the output safe to paste into my site?

Yes. Everything from your input is escaped before any markup is added, so text containing a tag comes out as visible text rather than as markup. Nothing you paste in can become executable code in the page you paste the result into.

What happens to URLs?

They become links, and only after the text has been escaped — so only a genuine http or https address turns into an anchor. Every generated link carries rel="noopener", because a link you did not write should not get a handle on your window.

Fragment or full page?

A fragment by default, which is what you want when pasting into a CMS or an existing template. Turn on the full-page option for a standalone file with a doctype and a charset.

Will it keep my indentation?

No. HTML collapses whitespace, and preserving indentation would mean wrapping everything in a pre block, which is a different tool. If you need code formatting, that is not what this does.

Is anything uploaded?

No. The conversion runs in your browser as you type. This page has no upload endpoint, and a file you drop is read on your own device.

About this converter

The output is escaped and safe to paste, but read it before publishing — particularly if the text came from someone else. Escaping stops markup becoming code; it does not vouch for what the words say. This converts structure, not meaning.

TXT to JSON

A .txt file or plain text into valid JSON.

Text Tools

PPT to HTML

Turn a deck into clean, readable HTML sections.

Document Tools

CSV to TXT

CSV to plain text, with the delimiter under your control.

Data Tools

More in Text Tools All tools