It's "der Toaster" which makes it masculine. On the other hand, a girl ("das Mädchen") is neuter. The grammatical gender is somewhat arbitrary and does not follow any "real" rules.
As a German you somehow "feel" if the correct article is used, though.