Skip to content

<samp> - The Sample Output Element

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.

Result
<samp>sample output</samp>

The <samp> element represents text that is output by a computer program or system.

Result
Result
Result
Result
Result
<!-- Computer/program output -->
<p>Output: <samp>Process complete</samp></p>

Combine <kbd> and <samp> to show input/output:

Result

For longer output, combine with <pre>:

Result

Customize output appearance:

Result
Result
Result
Result
Result
Result
Result

Show code and its output:

Result

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><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>
Result
BrowserVersionNotes
Chrome1+Full support
Firefox1+Full support
Safari1+Full support
Edge12+Full support
IE3+Full support

The <samp> element has been supported since the earliest browsers.