Show HN: An interactive demo of QR codes' error correction
5 comments
·April 25, 2025myself248
Oh, this is cool. My favorite part is being able to mouse over the health bars at the right, and see exactly which bits they draw from in the code itself.
gen3
Very cool work! I really like being able to see the blocks and directly interact with them. It's nice to feel out how the ECC works. I can see myself using this to draw custom QR codes in the future!
flysand7
It's surprising how much data you need to corrupt while still being able to read the QR code, that's what I'd take out from this. The demo is interesting in that respect, but I do think it's somewhat incomplete.
It seems to be missing some explanations regarding how the code is structured and how it performs error correction. I feel like there's little point in interacting with a system you don't understand or not trying to understand. And I also think there are cool ways to make those things interactive as well. Pick an image, then explain what the little squares in the corners are for and provide little interactivity to see how they affect the decoding. Then move on to the error correction. This step-by-step style of interactivity may be better, I'd think about that.
As for what is there, the first thing I don't like here is icons. The four icons in the lower-right corner (result data, format info, ..) are hard to distinguish, and are hard to correlate with the "history" tab. I'd probably either make them slightly different color, or actually simplifying these icons further might be a better option, just because they're so small.
But yeah it is pretty hard to tell what I'm interacting with, unfortunately. I don't know pretty much nothing about QR codes, and I don't know what the different kinds of errors are, what "EC" stands for etc.
UI should probably be rethought as well, because before I was writing the comment I had no idea I could switch a brush. Hell, I had no idea I was changing colors (the cursor covered half the space of the pixels, so I couldn't tell)
The idea's cool though, good work
Xiione
Thank you so much for the honest feedback. One of the reasons I tried to not get into the math details is because the preliminaries would be somewhat lengthy, some people would not be familiar with what a finite field is so explaining even that succinctly would be its own challenge for me. But for those that the concepts are within reach for (like the folks here on HN), you are right that I ought to make some effort to explain what is going on, at least intuitively. As for the UI considerations, great feedback, I'll definitely take it all into account when re-designing. I'm open to additional suggestions from everybody.
Ultimately I'm glad that I was able to get the main point across. That is, that QR codes can take a lot more abuse than one might assume. Thanks for checking my work out!
boomskats
How can you say that you 'don't know pretty much nothing about QR codes' and that you 'feel like there's little point in interacting with a system you don't understand or not trying to understand', while feeling qualified enough to write a critique claiming a demo of said thing you know pretty much nothing about is incomplete?
You don't know what EC stands for but you have an opinion on when the error correction should be demoed? And the first thing you don't like are the icons?
OP, if I were you I would ignore this critique entirely. This is a fantastic demo. The usability was spot on (I learned a lot in a very short amount of time) and your /repos readme is _exactly_ what I wanted to read. It is perfectly executed.
I'm gonna dig into your code a bit more tomorrow, but you should be very proud of this. You have a bright future ahead of you.
Hi HN! This is a hobby project of mine that recently landed me my first interview and helped me get my first internship offers.
Draw on a QR code, and the health bars will accurately display how close the QR code is to being unscannable. How few errors does it take to break a QR code? How many errors can a QR code handle? Counters at the bottom track your record minimum and maximum damage. (Can you figure out how to break a QR code with 0.0% damage to the actual data region?)
Also, click on the magnifying glass button to toggle between "draw mode" and "inspect mode". I encourage you to use your phone's camera to scan the code as you draw and undo/redo to verify that the code really does break when the app says it does.
I wrote the underlying decoder in C++, and it's compiled to WebAssembly for the website.
I hope you find it interesting.