Prism Diff Viewer compares two pieces of text or code and shows exactly what changed, the way you are used to seeing it on GitHub. It uses the Myers O(ND) algorithm for minimal diffs, pairs changed lines to highlight individual words, and exports a standard unified patch.
- Split view with paired lines and word-level
del/inshighlights - Unified view with old and new line numbers
- Patch view: standard unified diff with 3 lines of context
- Ignore whitespace / case options
- Open files from disk, rename sides, swap, copy patch
- Implemented with the Myers diff algorithm, no libraries
![]() |
![]() |
Use it online: https://krishyaa06.github.io/prism-diff-viewer/
Run locally:
git clone https://github.com/krishyaa06/prism-diff-viewer.git
cd prism-diff-viewer
# open index.html in your browser, or serve it:
npx serve .- Paste the original on the left and the changed version on the right (or Open files).
- Pick Split, Unified or Patch.
- Copy patch to share or
git applyit.
prism-diff-viewer/
βββ assets/
β βββ logo.png
β βββ logo.svg
βββ css/
β βββ app.css
β βββ prism.css
βββ js/
β βββ app.js # UI rendering
β βββ core.js # Myers diff, rows, unified patch β tested in Node
β βββ prism.js
βββ test/
β βββ core.test.js
βββ .gitignore
βββ LICENSE
βββ README.md
βββ index.html
βββ package.json
npm testTests use the built-in node:test runner, so there is nothing to install. CI runs them on Node 20 and 22.
- Fork the repo and create a branch:
git checkout -b feature/my-idea - Make your change and add a test in
test/ - Run
npm testand open a Pull Request
Prism Diff Viewer is one of the open-source tools built by Prism Protocol, a tech community where young builders learn, ship and compete together.
![]() Soumya Bhandare Founder @ Prism Protocol |
|
Released under the MIT License.
If you like this project, consider giving it a β
"Build. Create. Compete." Β· Made with β‘ by Prism Protocol



