CI Coverage Deploy License: MIT Node.js Code style: Prettier PRs Welcome JavaScript Top Language Repo Size Last Commit Commit Activity Open Issues Open PRs Stars Forks Watchers Ask DeepWiki
A simple React web app that lets you upload or drag & drop any file and view its contents in hexadecimal and ASCII format. The project is available in 26 languages, supports dark mode, is fully tested with Vitest, and can be easily deployed to GitHub Pages.
image- Hex Viewer: Displays the hex bytes of a file alongside their ASCII representation, 16 bytes per row.
- Drag & Drop or Upload: Easily load files via file input or drag & drop.
- Search / Filter: Instantly filter rows by hex (spaces optional), ASCII text, or offset.
- Copy & Download: Copy the formatted hex dump to your clipboard or download it as a
.txtfile. - 26 Languages: Fully internationalized UI with an in-app language selector and automatic browser-language detection (including Traditional Chinese and right-to-left support for Arabic and Urdu).
- Dark Mode: Toggle between light and dark modes for better readability.
- Privacy-first: Files are parsed entirely in your browser β nothing is ever uploaded. See PRIVACY.md.
- Clean and Intuitive UI: Hex and ASCII columns are styled for clarity.
- Responsive Design: Works well on desktop and tablet screens.
The live demo is deployed here:
To run the app locally:
- Clone the repository:
git clone https://github.com/doctorlai/hex-viewer.git
cd hex-viewer- Install dependencies:
npm install
- Start the development server:
npm run dev
- Run tests:
npm run test # Run once npm run coverage # Run with coverage (enforces minimum thresholds)
- Lint & format code:
npm run lint # Check for lint errors npm run lint:fix # Auto-fix lint errors npm run format # Check formatting npm run format:fix # Automatically fix formatting
- Run everything at once (format, lint, coverage, build):
npm run check
- Open http://localhost:5173/ in your browser.
| Script | Description |
|---|---|
npm run dev |
Start the Vite development server. |
npm run build |
Build the production bundle into dist/. |
npm run preview |
Preview the production build locally. |
npm run test |
Run the test suite once. |
npm run test:watch |
Run tests in watch mode. |
npm run coverage |
Run tests with coverage and enforce minimum thresholds. |
npm run lint |
Lint the codebase with ESLint. |
npm run lint:fix |
Lint and auto-fix issues. |
npm run format |
Check formatting with Prettier. |
npm run format:fix |
Auto-format the codebase. |
npm run check |
Run format, lint, coverage, and build together. |
npm run locales:generate |
Regenerate src/locales/*.json translation files. |
npm run deploy |
Build and deploy to GitHub Pages. |
- Upload a file or drag & drop it into the app.
- View the fileβs hexadecimal bytes and ASCII representation side by side.
- Use the search box to filter rows by hex (e.g.
48 65or4865), ASCII text, or offset. - Copy π the hex dump to your clipboard or download πΎ it as a
.txtfile. - Change the language π from the selector in the top toolbar.
- Toggle Light/Dark Mode using the π/π button.
- Press ποΈ Clear to reset and load another file.
Hex Viewer ships with 26 UI languages, including Traditional Chinese. Translation
strings live in src/locales/ and are generated from a single
source of truth in scripts/generate-locales.mjs.
To add or update a translation, edit the generator and run:
npm run locales:generate
See CONTRIBUTING.md for details.
Contributions are welcome! Please read the Contributing Guide and our Code of Conduct before getting started.
- Fork the repository.
- Create a feature branch:
git checkout -b feature-branch
- Make your changes and ensure
npm run checkpasses. - Commit your changes:
git commit -am 'Add new feature'- Push to your fork:
git push origin feature-branch
- Open a Pull Request.
- π Contributing Guide
- π Support
- π Security Policy
- π΅οΈ Privacy Policy
- π€ Code of Conduct
- π Changelog
- π€ AI-generated docs (DeepWiki)
This project is licensed under the MIT License - see the LICENSE file for details.