HTML <var> Tag

The <var> tag describes variable in a mathematical expression or a programming context. Its content is usually presented in an italicized version of the current typeface.

Other elements that are used for describing technical parts of the documents in the contexts in which <var> is generally used include:

  • the <code> tag, which defines a piece of computer code
  • the <samp> tag, which defines sample output from a computer program or script
  • the <kbd> tag, which defines keyboard output


The <var> tag comes in pairs. The content is written between opening (<var>) and closing (</var>) tags.


<!DOCTYPE html>
    <title>Title of the document</title>
    <var>This is a variable</var>



The <var> tag supports the Global attributes and the Event Attributes.

Browser support

Related articles