Inline
HTML 2.0
The sample output element represents sample or quoted output from a computer program, script, or system. It’s typically rendered in a monospace font.
<samp>sample output</samp>
The <samp> element represents text that is output by a computer program or system.
<!-- Computer/program output -->
<p>Output: <samp>Process complete</samp></p>
<!-- User keyboard input -->
<p>Type: <kbd>npm start</kbd></p>
<p>Use: <code>console.log()</code></p>
<p>Value of <var>x</var> is 10</p>
Combine <kbd> and <samp> to show input/output:
For longer output, combine with <pre>:
Customize output appearance:
Show code and its output:
Screen readers typically read <samp> content as regular text. The monospace styling is visual only.
Make it clear what the output represents:
<p><samp>Error 404</samp></p>
<p>The server returned: <samp>Error 404: Not Found</samp></p>
<p><strong>Expected output:</strong></p>
<p><samp>Process completed successfully</samp></p>
<p><strong>Actual output:</strong></p>
<p><samp>Error: Connection timeout</samp></p>
| Browser | Version | Notes |
|---|
| Chrome | 1+ | Full support |
| Firefox | 1+ | Full support |
| Safari | 1+ | Full support |
| Edge | 12+ | Full support |
| IE | 3+ | Full support |
The <samp> element has been supported since the earliest browsers.