Are binary compounds ionic or covalent? If they are covalent, I thought they don't form bonds that way, since they share electrons.

NaCl is ionic and that's a binary compound.

NO2 is a covalent compount and that is a binary compound.
Many binary compounds are covalent. SO2, NO, NO2, N2O4, N2O3, N2O5, P2O5, P2O3, Cl2O, just to name a few. And these share electrons to form the covalent bond.

Binary compounds can be either ionic or covalent, depending on the type of elements involved. Ionic compounds are formed when a metal combines with a nonmetal, while covalent compounds are formed when two nonmetals combine.

In ionic compounds, the metal atom donates one or more electrons to the nonmetal atom, resulting in the formation of positively charged cations and negatively charged anions. These oppositely charged ions are held together by strong electrostatic forces, creating an ionic bond.

On the other hand, covalent compounds are formed when two nonmetal atoms share electrons. This sharing of electrons creates a bond between the atoms, known as a covalent bond. In covalent compounds, the shared electrons are localized in the space between the two atoms, allowing for a more equal sharing of electron density.

It is important to note that even though covalent compounds involve the sharing of electrons, they still form bonds. The shared electrons create a stable arrangement, allowing the atoms to achieve a lower energy state by filling their outer electron shells. This sharing of electrons is what holds the atoms together in a covalent compound.