
I Built a Subway Nutrition Calculator
A few months ago, I got tired of clicking through Subway’s website to figure out what I was actually eating. Their PDFs are fine if you want to look up one thing. But if you want to build a custom sandwich—add this bread, skip that cheese, double the chicken, then see how it fits into your daily calories good luck. So, I built this calorie calculator . Not a fancy app with a backend. Just a single HTML file with a ton of JavaScript, a massive JSON‑like data structure, and a stubborn refusal to let a bad UI ruin my lunch. I’m going to walk you through how I built it, what broke along the way, and what I’d do differently next time. The Problem You’d have to manually add bread calories + meat calories + veggie calories (most are zero, but olives and avocado aren’t) + sauce calories. Then double it for footlong. Then remember that cheese adds fat and sodium. Then realize you forgot the salt and pepper. It’s tedious and error‑prone. And it’s exactly the kind of problem a simple web tool can
Continue reading on Dev.to
Opens in a new tab

.png&w=1200&q=75)