iReV: An EV Charging Calculator in One HTML File
Charging an electric car in India is harder to estimate than filling a petrol tank. Chargers range from a 3-pin wall socket to DC fast units, each network prices energy differently, and GST of 18% changes the final bill. I wanted a quick answer to simple questions: how long will this take, what will it cost, and where is the nearest station? So I built iReV, which I call Charge Matrix, a calculator and station finder for Indian EV owners.
Why I built it
The vehicle I had in mind first was the Mahindra XEV 9e Cineluxe. A typical question for a new owner is: how long and how much to charge from 20% to 80% at a mall charger? Answering that by hand means knowing the battery size, the charger's power, the operator's rate and the tax. Most people do not want to do that arithmetic in a parking lot.
The other gap was discovery. Charging networks each have their own app, and it is not obvious which one you need to pay at a given station. I wanted one place that handled the maths, the map and the app links.
What it does
The app has three tabs.
Calculator
- Vehicle selector: three cascading dropdowns, Manufacturer, Model and Variant. It defaults to Mahindra, XEV 9e, Cineluxe (79 kWh). The data covers 40+ Indian EV models across 14 manufacturers.
- Battery state: a row of 20 cells, each representing 5% of state of charge (SOC). Green cells are charge already stored, pulsing cyan cells are the energy about to be added, and dark cells are the remaining capacity. Sliders set the starting and target SOC.
- Charger selection: 14 charger types, grouped as DC and AC, covering CCS2, Type 2, Type 6, BHIM and 3-pin.
- Settings: price per unit, battery kWh and efficiency in km/kWh, all editable.
- Results: time, cost, range and energy, with a breakdown that includes the 18% GST.
Live Stations
This tab detects your location and lists nearby stations with distance, pricing, plug availability and one-tap navigation. You can switch between a list and a map, pick a search radius, and filter by chips such as Malls, DC, AC, CCS2, Type 2, 50kW+ and Available. Station data comes from the OpenChargeMap API. If the network is unavailable, the app falls back to 14 curated Hyderabad stations.
Charging Apps
A grid of 14 charging network apps with Android and iOS store links, so a new user can see which app to install for a given operator.
How it works
The whole product is one index.html file containing the HTML, CSS and JavaScript. There is no build step and no server. It is hosted on GitHub Pages, and the only external dependencies are Leaflet.js 1.9.4 for the map, using OpenStreetMap tiles, and the OpenChargeMap v3 API for live station data.
Inside the script, the data lives in plain arrays and objects:
VEHICLES[]: 40+ vehicles with battery, range and efficiency dataCHARGERS[]: the 14 charger definitionsOP_RATES{}: 20 operator pricing entries, each with a base rate and GSTFALLBACK_STATIONS[]: the 14 curated Hyderabad stationsAPPS[]: the 14 charging apps and their store links
Around that sit roughly 30 JavaScript functions that handle the selectors, rendering, calculation and station fetching.
Choices worth reusing
Real-world efficiency, not the brochure number. When you pick a variant, the app fills the km/kWh field with the variant's WLTP efficiency multiplied by 0.70, capped at 8.5. WLTP figures are lab results, so a 70% factor gives a more honest range estimate, and because the field stays editable you can correct it with your own experience.
Cascading dropdowns from one data structure. Changing the make repopulates the models and resets to the first one. Changing the model does the same for variants. Changing the variant sets the battery size, efficiency, header badge and results in one pass. Keeping the reset rules simple avoids stale combinations.
Graceful fallback. A live API is a dependency you do not control. Shipping a small curated list means the Stations tab still shows something useful when the request fails, and a status bar tells the user whether data is live, cached or loading.
Navigation by name. Station links open Google Maps with a name-based search rather than raw coordinates, which I found gives more accurate results for pointing someone to the right place.
No build toolchain. For a tool this size, a single file removes deployment friction entirely: push to the main branch and it is live. The trade-off is that data and code share a file, which gets harder to maintain as the vehicle list grows.
What I learned
- Writing the product specification in the README before and during the build kept scope under control. I listed non-goals explicitly: no payments, no slot reservation, no telematics, no trip planning and no push notifications.
- A visual battery pack communicates SOC ranges faster than two numbers. Splitting it into 5% cells made the start and target readable at a glance.
- Pricing data is the hard part. Showing the GST breakdown separately matters because the base rate and the amount you actually pay differ.
- Data-driven UI pays off. Because vehicles, chargers, operators and apps are plain data, adding an entry does not require touching the rendering logic.
Try it
You can use the app here: https://irev-ir.vercel.app. Pick your vehicle, set your SOC range, choose a charger and see the time, cost and range. Then open the Live Stations tab to find a charger nearby.
Conclusion
iReV is a small project with a narrow goal: take the guesswork out of EV charging in India. It runs as a single HTML file with Leaflet and OpenChargeMap as its only dependencies, and that simplicity is the main design decision I would carry into similar tools. If you have a correction to the data or a feature idea, write to me at hello@iramesh.com.