A professional online tool for generating invoice numbers, built with pure HTML, CSS, and JavaScript. Perfect for businesses, developers, and accounting software integration.
- Multiple numbering formats (Sequential, Date-based, Client-based)
- Excel/Google Sheets compatible
- Custom prefix and suffix support
- Bulk generation capability
- No registration required
- Free to use
Try it now: https://format.im/
[PREFIX]-[MAIN_NUMBER]-[SUFFIX]
-
Sequential Numbers
INV-0001 INV-0002 INV-0003 -
Date-Based
20240121-001 20240121-002 INV/2024/001 -
Client/Project Based
CLI001-INV-001 PRJ001-INV-001 -
Financial Year
FY24-0001 FY24-0002
function generateInvoiceNumber(format, counter, options = {}) {
const {
prefix = 'INV',
suffix = '',
padding = 4,
separator = '-'
} = options;
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const number = String(counter).padStart(padding, '0');
switch (format) {
case 'sequential':
return `${prefix}${separator}${number}${suffix ? separator + suffix : ''}`;
case 'date':
return `${year}${month}${day}${separator}${number}`;
case 'fiscal':
return `FY${year.toString().slice(-2)}${separator}${number}`;
default:
return `${prefix}${separator}${number}`;
}
}from datetime import datetime
def generate_invoice_number(format_type, counter, **options):
prefix = options.get('prefix', 'INV')
suffix = options.get('suffix', '')
padding = options.get('padding', 4)
separator = options.get('separator', '-')
now = datetime.now()
number = str(counter).zfill(padding)
formats = {
'sequential': f"{prefix}{separator}{number}{separator + suffix if suffix else ''}",
'date': f"{now.strftime('%Y%m%d')}{separator}{number}",
'fiscal': f"FY{str(now.year)[2:]}{separator}{number}"
}
return formats.get(format_type, formats['sequential'])-
Uniqueness
- Never reuse invoice numbers
- Use sufficiently large padding (e.g., 4 digits minimum)
- Consider adding business unit identifiers for multiple departments
-
Consistency
- Maintain consistent format throughout the fiscal year
- Use clear separators between components
- Keep a logical sequence
-
Readability
- Avoid ambiguous characters (I, l, O, 0)
- Use meaningful prefixes
- Limit total length to 15-20 characters
-
Compliance
- Follow local tax regulations
- Include year/date information when required
- Maintain proper audit trails
- Pure HTML/CSS/JavaScript
- No external dependencies
- Cross-browser compatible
- Mobile responsive
- Clipboard API integration
Contributions are welcome! Feel free to submit issues and enhancement requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License .
- Inspired by real-world business needs
- Built with modern web standards
- Community feedback and contributions
For support and questions, please open an issue or contact us at support@format.im.
⭐ Don't forget to star this repo if you find it useful!
