Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s used in millions of websites, including some of those you visit daily.
All styling is done through CSS.
This is free and open source software.
Key Features
- Only 2KB minified & gzipped (core). Each language definition adds roughly 300-500 bytes.
- Encourages good author practices.
- The language-xxxx class is inherited. This means that if multiple code snippets have the same language, you can just define it once,in one of their common ancestors.
- Supports parallelism with Web Workers, if available. Disabled by default (why?).
- Very easy to extend without modifying the code, due to Prism’s plugin architecture. Multiple hooks are scattered throughout the source.
- Very easy to define new languages. The only thing you need is a good understanding of regular expressions.
- All styling is done through CSS, with sensible class names rather than ugly, namespaced, abbreviated nonsense.
- Wide browser support: Edge, IE11, Firefox, Chrome, Safari, Opera, most mobile browsers.
Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside HTML). - Highlights inline code as well, not just code blocks.
- It doesn’t force you to use any Prism-specific markup, not even a Prism-specific class name, only standard markup you should be using anyway. So, you can just try it for a while, remove it if you don’t like it and leave no traces behind.
- Highlight specific lines and/or line ranges (requires plugin).
- Show invisible characters like tabs, line breaks etc (requires plugin).
- Autolink URLs and emails, use Markdown links in comments (requires plugin).
- Large range of plugins.
Website: prismjs.com
Support: GitHub Code Repository
Developer: Lea Verou
License: MIT License
Prism is written in JavaScript. Learn JavaScript with our recommended free books and free tutorials.
Related Software
| Syntax Highlighters | |
|---|---|
| Prism | Lightweight, extensible syntax highlighter, with modern web standards in mind |
| Re-Highlight | Powerful syntax highlighter |
| Chroma | General purpose syntax highlighter |
| Pygments | Generic syntax highlighter |
| Rouge | Pure Ruby syntax highlighter |
| Highlight.js | JavaScript syntax highlighter with language auto-detection |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

