No they're not the same or they would have the same numbers. They may well look the same, but they will be for different printers and that's why HP make them differently
They're the same fit but different size. A 21 is much smaller than a 56 and you often find theseincluded with new printers, you can replace the empty 21 with either but a 56 will last much longer but more expensive. Typically a new 56 is around �10. Don't buy refilled 56's or 57's, they can be rubbish