When the Lord finished speaking to Moses on Mount Sinai, he gave him the two tablets of the covenant law, the tablets of stone inscribed by the finger of God. (Exodus 31:18, NIV)
According to Keil there was only 172 words (the decalogue) in Exodus 20:2–17 that were written on the stones by the 'finger of God'. This would have easily fit.
Nothing is said about the dimensions of the tables: at the same time, we can hardly imagine them to have been as large as the inside of the ark; for stone slab 2 1/2 cubits long and 1 1/2 cubits broad, which must necessarily have been some inches in thickness to prevent their breaking in the hand, would have required the strength of Samson to enable Moses to carry them down the mountain “in his hand” (Ex. 32:15), or even “in his two hands” (Deut. 9:15, 17). But if we suppose them to have been smaller than this, say at the most a cubit and a half long and one cubit broad, there would have been half long and one cubit broad, there would have been plenty of room on the four sides for the 172 words contained in the decalogue, with its threats and promises (Ex. 20:2–17), without the writing being excessively small. (Commentary on the Old Testament, by C.F. KEIL and F. DELITZSCH, 1.463-464)