Skip to content

Your text

✨ HTML updates as you type 0 words

HTML code

Type or paste your text on the left

Its HTML code and a preview will appear here
Nothing to convert yet

Text to HTML Converter – Free Online Tool

What is a Text to HTML Converter?

It turns normal text into HTML code you can put on a web page. You write the way you would in a word processor: make words bold, center a line, give a heading some color, add a list or a link. The tool writes the matching tags for you, like <p>, <h2>, <strong> and <a href>, and shows the code next to your text as you type.

It’s handy when a CMS, an email template or a forum wants HTML and you just have text, when you’re learning which tag does what, or when you need a quick snippet without opening a code editor. Everything runs in your browser, and the HTML stays short and clean, with no hidden styles or classes.

How to Use It – Step by Step

Five short steps. Click Sample in the tool above to see every feature at once.

Step 1 Type or Paste Your Text

Start typing in the left panel, or paste text from anywhere. A paste keeps only the words: every blank line starts a new paragraph, a single line break becomes a <br>, and web addresses turn into links. Formatting from Word or Google Docs is left behind on purpose, so you don’t inherit their messy markup.

Try it: paste this text

Text:

Opening hours

Monday to Friday: 8am to 6pm
Saturday: 9am to 1pm

More at www.example.com

HTML:

<p>Opening hours</p>
<p>Monday to Friday: 8am to 6pm<br>Saturday: 9am to 1pm</p>
<p>More at <a href="https://www.example.com">www.example.com</a></p>

Step 2 Format It with the Toolbar

Select some words and click a button, or use the shortcuts you already know. The button lights up lime when the text under your cursor has that format.

  • Bold, italic, underline, strike: Ctrl+B, Ctrl+I, Ctrl+U, Ctrl+Shift+S (⌘ on a Mac).
  • Align: left, center, right or justify for the whole paragraph or heading.
  • Text color and highlight: pick one of ten colors or your own, or mark words in yellow.
  • Link: select the words, press Ctrl+K and type the address. Tick “Open in a new tab” if you need it.
  • Clear formatting: takes everything off the selection, so you can start over.

Step 3 Add Headings and Lists

Put the cursor in a line and click H1, H2 or H3 to make it a heading, or P to turn it back into a paragraph. Use one <h1> for the page title and <h2> for sections, so screen readers and search engines understand the outline. The list buttons give you bullets (<ul>) or numbers (<ol>). Shortcut: type - or 1. at the start of a line.

Try it: a heading and a bullet list

<h2>Opening hours</h2>
<ul>
  <li>Monday to Friday: 8am to 6pm</li>
  <li>Saturday: 9am to 1pm</li>
</ul>

Step 4 Check the Code and the Preview

The right panel shows the HTML, neatly indented. Switch to Preview to see how a browser draws it. Tick Full HTML page if you want a complete document with <!DOCTYPE html>, <head> and <body> instead of a snippet. Special characters are escaped for you, so text that looks like a tag stays text.

Try it: type this sentence

You type:

Use <b> for bold & <i> for italic

HTML:

<p>Use &lt;b&gt; for bold &amp; &lt;i&gt; for italic</p>

Step 5 Copy or Download

  • Copy: puts the HTML on your clipboard, ready to paste into your site, CMS or email.
  • Download: saves a full .html page, named after your first heading.
  • Come back later: your text is remembered in this browser until you click Clear.
  • Need the opposite? The HTML to Text converter strips the tags from HTML and gives you plain text again.

How to Center Text in HTML

Add text-align: center to the element that holds the text, like a <p> or a heading. It centers the lines inside that block. In the editor, put the cursor in the line and click Center (Ctrl+Shift+E).

Before:

<p>Free shipping on all orders</p>

After:

<p style="text-align: center">Free shipping on all orders</p>

The CSS way: when you center the same kind of text in many places, give it a class and put the rule in your stylesheet once.

.center {
  text-align: center;
}
<p class="center">Free shipping on all orders</p>

Skip the old <center> tag: it still works, but it’s obsolete. And text-align centers the text inside a block. To center the block itself (say, a box with a width), use margin: 0 auto.

How to Change Text Color in HTML

Use the CSS color property. For a few words, wrap them in a <span> with a style. For a whole paragraph, put the style on the <p> itself. In the editor, select the words, click Text color and pick a swatch or your own color.

Before:

<p>Sale ends tonight</p>

After:

<p>Sale ends <span style="color: #dc2626">tonight</span></p>

The CSS way: a class keeps your colors in one place, so changing the shade later is a one-line edit.

.alert {
  color: #dc2626;
}
<p>Sale ends <span class="alert">tonight</span></p>

The value can be a hex code (#dc2626), rgb(220 38 38) or a name like red. Need the exact code for a shade? Use our HTML Color Picker. Keep enough contrast with the background so everyone can read it. The old <font color> tag is obsolete.

How to Make Text Bold in HTML

Wrap the words in <strong>. Browsers show it in bold, and it also tells screen readers and search engines that those words matter. In the editor, select the words and press Ctrl+B.

Before:

<p>Please read this first</p>

After:

<p>Please <strong>read this first</strong></p>

The CSS way: if the text is only bold for looks (a label, a whole note), use font-weight.

.note {
  font-weight: bold;
}
<p class="note">Please read this first</p>

<b> makes text bold too, but without the “this is important” meaning. Pick <strong> for importance and <b> or CSS for style only.

Frequently Asked Questions

How do I convert plain text to HTML?

Paste or type your text in the left panel. Every blank line starts a new paragraph (<p>), a single line break becomes a <br>, and web addresses turn into links. Use the toolbar to add headings, bold text, colors, lists or alignment, and the HTML code on the right updates as you type. Then click Copy or Download.

Why does pasting from Word or Google Docs lose the formatting?

On purpose. Word and Google Docs put a lot of hidden styles, classes and spans in their HTML, and you’d spend longer cleaning that up than formatting the text yourself. So a paste keeps only the words and the paragraph breaks. Then add bold, headings and colors with the toolbar, and you get short, clean HTML.

How do I center text in HTML?

Add text-align: center to the block that holds the text, for example <p style="text-align: center">Hello</p>. In this editor, put the cursor in a paragraph or heading and click the Center button (or press Ctrl+Shift+E). The old <center> tag still works in browsers, but it’s obsolete, so use CSS instead.

How do I change the text color in HTML?

Wrap the words in a <span> with a color style: <span style="color: #dc2626">red text</span>. You can use a hex code, rgb() or a color name like "blue". Here, select the text, click the Text color button and pick a swatch or your own color. Our HTML Color Picker helps you find the exact code.

How do I make text bold in HTML?

Use <strong>important text</strong>. It looks bold and also tells screen readers and search engines the words matter. <b> also makes text bold, but without that meaning. If you only want the bold look, use CSS: font-weight: bold. In the editor, select the words and press Ctrl+B.

Is the HTML safe to put on my website?

Yes. Characters like < and & that you type are turned into &lt; and &amp;, so your text can never break the page or sneak in a tag. The output only contains simple tags such as <p>, <h2>, <strong>, <ul> and <a>, plus inline styles for alignment and color.

Can I get a complete HTML page instead of a snippet?

Tick “Full HTML page” and the code is wrapped in a minimal document with <!DOCTYPE html>, <head>, a <title> from your first heading and <body>. Download always saves a full page, so the .html file opens nicely in any browser.

Is my text uploaded or saved anywhere?

No. Everything happens in your browser and nothing is sent to a server. Your text is kept in this browser’s local storage so it’s still there when you come back. Click the Clear button to remove it.