Markdown Keyboard Input
How to format keyboard shortcuts and key names in markdown using the HTML kbd element. Syntax, examples, and platform support.
What is markdown keyboard input?
Keyboard input formatting uses the HTML <kbd> tag to display key names and shortcuts in a styled box that visually represents a physical key. It is commonly used in documentation and tutorials to indicate what keys to press.
Syntax
Single key
Wrap the key name in <kbd> tags.
Key combination
Use + between individual key tags to show combinations.
Mac shortcut
Use unicode symbols for Mac modifier keys.
Platform support
| Platform | Supported | Notes |
|---|---|---|
| GitHub | Yes | HTML <kbd> rendered |
| GitLab | Yes | — |
| Obsidian | Yes | — |
| Discord | No | HTML not rendered — use backtick inline code instead |
| Notion | Partial | Paste as HTML embed |
| Slack | No | — |
Common mistakes
`Ctrl+C`
<kbd>Ctrl</kbd>+<kbd>C</kbd>
Inline code works as a fallback but does not render the key-cap visual style that <kbd> provides.
Tips for keyboard input
Use separate <kbd> tags for each key in a combination, joined with + or /. This makes each key visually distinct.
On platforms that don't render HTML (Discord, Slack), use `Ctrl+C` backtick inline code as a readable alternative.
Frequently asked questions
Everything you need to know.
What does <kbd> do in markdown?
<kbd> is an HTML tag that renders text in a keyboard-key style — typically a small box with a border. It's the standard way to document key presses in technical writing.
Related elements
Inline Code
Inline code is formatted by wrapping text in single backticks (`). It renders in a monospace font with a subtle background, making it ideal for variable names, commands, file paths, and short code snippets within a sentence.
HTML Block
Most markdown parsers allow you to embed raw HTML directly in your markdown file. HTML blocks let you use elements not supported by markdown — custom divs, details/summary, colored text, form elements, and more. HTML support depends on the platform — some sanitize or strip it entirely.
Bold
Bold text in markdown is created by wrapping words with double asterisks (**) or double underscores (__). Bold draws attention to important words and phrases, making your content easier to scan.
Try it in the editor
Paste your markdown and see keyboard input rendered instantly with professional themes.