A sleek and elegant converter that transforms numbers to Roman numerals and back. It works instantly and supports the standard Roman numeral range (1-3999).
- Instant Conversion: Just start typing, and the conversion happens automatically
- Works Both Ways:
- Type regular numbers (1994 → MCMXCIV)
- Or Roman numerals (MCMXCIV → 1994)
- Standard Roman Numerals: Supports all numbers from 1 to 3999 using traditional Roman numerals
- Elegant Interface: Beautiful astronomical clock-inspired design
-
Make sure you have:
- Java 21 (or newer)
- Maven
-
Fire it up:
# Clone the repo git clone https://github.com/yourusername/roman-converter.git cd roman-converter # Run it! ./mvnw spring-boot:run
-
Open in your browser:
http://localhost:8080
-
Just Type Away!
- Want to know how to write 42 in Roman numerals? Type "42"
- Can't read "MCMXCIV"? Type it in and get 1994
-
Valid Input Ranges:
- Numbers: 1 to 3999
- Roman Numerals: I to MMMCMXCIX
-
Example Conversions:
42 ↔ XLII (the answer to everything!) 1994 ↔ MCMXCIV 3999 ↔ MMMCMXCIX
We've got two simple endpoints:
-
To Roman:
POST /api/toRoman?number=1994 # Returns: MCMXCIV
-
From Roman:
POST /api/fromRoman?roman=MCMXCIV # Returns: 1994
We use a smart pattern system for each digit position:
// Units: 1-9
I, II, III, IV, V, VI, VII, VIII, IX
// Tens: 10-90
X, XX, XXX, XL, L, LX, LXX, LXXX, XC
// And so on...
This makes conversions lightning fast!
roman-converter/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/roman/converter/
│ │ │ ├── controller/ # API endpoints
│ │ │ ├── service/ # Conversion magic
│ │ │ └── Application.java
│ │ └── resources/
│ │ └── static/
│ │ └── index.html # Web interface
- Fork it
- Create your feature branch (
git checkout -b feature/CoolFeature
) - Commit your changes (
git commit -m 'Added an awesome feature'
) - Push to the branch (
git push origin feature/CoolFeature
) - Create a Pull Request
MIT License - do whatever you want, just keep the credits!
Create an issue or drop me a line! Let's make this converter even better together!