HTML <plaintext> Tag

The <plaintext> tag tells the browser, that its content must be displayed as an ordinary text without formatting. All the nested tags in this element are rendered by the browser as a part of the text. The content of the <plaintext> tag is represented in monospaced font. The monospaced font can be applied to any HTML element using the CSS font-family style with the "monospace" generic value.

The <plaintext> is a deprecated HTML tag, instead of it use the <pre> tag, or the <code> tag, if semantically accurate.
In the case, where <plaintext> is the first element on the page, using HTML is not preferable. Instead, you can serve a text file with the text/plain MIME-type.

Syntax

The <plaintext> tag is empty, which means that the closing tag isn’t required.

Example of the HTML <plaintext> property:

<!DOCTYPE html>
<html>
 <head>
    <title>Title of the document</title>
 </head>
  <body>
    <p>The tag content looks like this:</p>
    <plaintext>
    <h1>Main title of the document</h1>
    <p>First paragraph of the text</p>
    <h2>Subheading</h2>
  </body>
</html>

Result

plaintext tag example

Attributes

The <plaintext> tag supports the Global Attributes.

Browser support

chrome firefox safari opera
4+

Practice Your Knowledge

What is the function of the <plaintext> tag in HTML?

Quiz Time: Test Your Skills!

Ready to challenge what you've learned? Dive into our interactive quizzes for a deeper understanding and a fun way to reinforce your knowledge.

Do you find this helpful?