You have every right not to answer, that's clearly pretty personal info. But before you shut the door on it, I'd ask myself a question: do you know if your coworker is asking out of plain curiosity or because they're wondering if they're being paid fairly? Because honestly, it's the kind of thing we should be able to discuss without all this taboo stuff, especially when two people are literally doing the exact same job. If you're not making the same money, that's the kind of info that can actually be useful to know whether you need to negotiate your pay or not.
That said, if you're not comfortable with it, that's legit too. You can always just say something like "oh that's a bit personal for me" without it being weird at all. People who respect boundaries, they'll get it. But if you feel like your coworker is asking seriously and honestly, maybe you're blocking yourself for nothing? What exactly is bothering you - that it's a coworker who'd know, or are you just not comfortable with the topic in general?