Fenced Code Blocks in Markdown

From the Markdown cheat sheet ยท Code ยท verified Aug 2026

Fenced Code Blocks

Create multi-line code blocks with language hints.

markdown
~~~js
const message = 'Hello'
console.log(message)
~~~
๐Ÿ“Œ Put the language immediately after the opening fence
๐Ÿ’ก Tilde fences help when documenting backtick fences
๐Ÿ” Syntax highlighting depends on the renderer
๐ŸŽฏ Prefer fenced blocks over four-space indentation
fenced-codesyntax-highlightingcode-blocks

Continue with Markdown

Save the full cheat sheet or work through every related task.

More Markdown tasks

Back to the full Markdown cheat sheet