A comprehensive web-based tool for validating Malaysian Tax Identification Numbers (TIN) and National Registration Identity Card (NIRC) numbers. This validator supports all official TIN formats and provides extensive features for individual and bulk validation.
- ✅ Individual TINs - New version (IG + 10 digits) and Old version (SG/OG + 9 digits)
- ✅ Non-Individual TINs - New version (C/D/E/F + 10 digits) and Old version (C/D/E/F + 9 digits)
- ✅ General TINs - Predefined special-purpose TINs (EI00000000010, etc.)
- ✅ Pattern Validation - Verifies correct format and digit composition
- ✅ Input Sanitization - Automatically cleans and normalizes input
- 🎲 Random TIN Generation - Generate valid sample TINs for testing
- 📋 Bulk Validation - Validate up to 100 TINs simultaneously
- 📊 Real-time Statistics - Track validation success/failure rates
- 📝 Validation History - Maintains last 10 validations with timestamps
- 💾 Persistent Storage - History saved across browser sessions
- 📤 CSV Export - Export validation history with timestamps
- 📋 Clipboard Support - Modern clipboard API with fallback
- 🔒 Input Sanitization - Prevents injection attacks
- 🛡️ XSS Protection - All outputs properly escaped
- ♿ Accessibility - WCAG compliant with ARIA labels
- 📱 Responsive Design - Works on all device sizes
- 🎨 User-Friendly UI - Bootstrap 5 with smooth animations
- Open
index.htmlin a web browser - Enter a TIN or NIRC number in the input field
- Click "Validate" or press Enter to check validity
- View detailed information about the TIN type and category
- Click "Bulk Validation" to expand the section
- Enter one TIN per line in the textarea
- Click "Validate All" to process all TINs
- View summary and individual results
- View recent validations in the History section
- Click "Export History" to download as CSV
- Click "Clear History" to reset all data
- History automatically persists across sessions
| Type | Format | Length | Example |
|---|---|---|---|
| Individual (New) | IG + 10 digits | 12 | IG1234567890 |
| Individual (Old) | SG/OG + 9 digits | 11 | SG123456789 |
| Non-Individual (New) | C/D/E/F + 10 digits | 11 | C1234567890 |
| Non-Individual (Old) | C/D/E/F + 9 digits | 10 | C123456789 |
| General | EI + 10 digits | 13 | EI00000000010 |
- Frontend: Pure HTML5, CSS3, JavaScript (ES6+)
- UI Framework: Bootstrap 5.3.0
- Icons: Font Awesome 6.4.0
- Storage: LocalStorage API for persistence
- No Backend Required: Fully client-side validation
- ✅ Chrome/Edge 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Opera 76+
- Modern JavaScript: ES6+ features (arrow functions, template literals, async/await)
- Clipboard API: Modern navigator.clipboard with legacy fallback
- LocalStorage: Persistent data storage with error handling
- Accessibility: ARIA labels, roles, and live regions
- Responsive Design: Mobile-first approach with Bootstrap grid
- ✅ JSDoc Comments: Full documentation for all functions
- ✅ Input Validation: Comprehensive sanitization and checks
- ✅ Error Handling: Try-catch blocks with user feedback
- ✅ Performance: Optimized DOM operations
- ✅ Security: XSS prevention and input sanitization
Comprehensive test cases are available in TEST_CASES.md, including:
- Valid and invalid TIN examples for all formats
- Edge cases and boundary conditions
- Bulk validation scenarios
- Security and accessibility tests
- Performance benchmarks
malaysia-tin-validator/
├── index.html # Main HTML file
├── script.js # JavaScript validation logic
├── style.css # Custom styles
├── README.md # This file
├── TEST_CASES.md # Comprehensive test cases
└── tin_validator.png # Screenshot
- Clone the repository
- Open
index.htmlin your browser - No build process or dependencies required
- Test changes immediately
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch
- Make your changes with proper documentation
- Test thoroughly using TEST_CASES.md
- Submit a Pull Request
- ✨ Added comprehensive input sanitization
- ✨ Implemented localStorage for persistent history
- ✨ Enhanced accessibility with ARIA labels
- ✨ Improved error handling and user feedback
- ✨ Added bulk validation with summary results
- ✨ Modern Clipboard API with fallback
- ✨ Complete JSDoc documentation
- ✨ XSS protection for all outputs
- 🐛 Fixed CSS file reference bug
- 📚 Added comprehensive test cases
- 🎉 Initial release
- Basic TIN validation for all formats
- Random TIN generation
- Simple validation history
- CSV export functionality
Developer: Min Myat Oo Email: [email protected] Version: 2.0.0 Last Updated: November 2025
This project is open source and available under the MIT License.
For bug reports, feature requests, or questions, please open an issue in the repository.
Note: This validator checks format compliance only. For official TIN verification, please consult the Malaysian Inland Revenue Board (LHDN).
