**`<samp>`** represents text that a program actually **output** — a console log line, an error message, a terminal response — as opposed to `<code>` (the source code that produced it) or `<kbd>` (what a user types in). It's commonly used in documentation and tutorials to clearly show 'here's what you should see happen' after running a command.
1Understanding <samp>
`<samp>` represents text that a program actually output — a console log line, an error message, a terminal response — as opposed to <code> (the source code that produced it) or <kbd> (what a user types in). It's commonly used in documentation and tutorials to clearly show 'here's what you should see happen' after running a command.
In a tutorial that says 'run this command, and you'll see this output', use <code> for the command and <samp> for the resulting output — they look the same (monospace) but mean different things.
<p>Run <code>npm test</code> and you should see: <samp>✓ 12 tests passed</samp></p>2Practical Example
Here is a real-world application of <samp> showing how it is used in production HTML.
<!-- Multi-line terminal output -->
<pre><samp>Compiling...
Build succeeded in 2.3s
Server running at http://localhost:3000</samp></pre>3Best Practices
Follow these guidelines when working with <samp>:
1. Use <samp> specifically for program/terminal output shown to the reader
2. Pair it with <code> (for the command) and <kbd> (for user input) in tutorials for clarity
3. Use <pre><samp> together when the output spans multiple lines
Tip: In a tutorial that says 'run this command, and you'll see this output', use <code> for the command and <samp> for the resulting output — they look the same (monospace) but mean different things.
<p>Run <code>npm test</code> and you should see: <samp>✓ 12 tests passed</samp></p>