The formula of sodium chloride is NaCl and that of sodium carbonate is Na2CO3.
An aqueous solution of sodium chloride is neutral because sodium chloride is formed from a strong acid, hydrochloric acid (HCl), and a strong base, sodium hydroxide(NaOH). When sodium chloride is dissolved in water, it gets hydrolysed to give equal amounts of hydroxide and hydrogen ions, and this makes its aqueous solution neutral.
NaCl(s) + H2O(l) → NaOH(aq) + HCl(aq)
An aqueous solution of sodium carbonate (washing soda) is alkaline because it is a salt prepared from the reaction of a weak acid, carbonic acid (H2CO3), and a strong base, sodium hydroxide (NaOH). When sodium carbonate is dissolved in water, it gets hydrolysed to some extent and forms sodium hydroxide and carbonic acid.
Na2CO3(s) + 2H2O(l) → 2NaOH(aq) + H2CO3(aq)
Sodium hydroxide, being a strong base, is fully ionised to give a large amount of hydroxide ions (OH-), and carbonic acid, being a weak acid, is slightly ionised to form a small amount of hydrogen (H+) ions. Therefore, an aqueous solution contains more hydroxide ions than hydrogen ions, and this makes the solution basic.