Until the late 1850s, Spanish-American coins were legal tender in the United States. By far the leading specie coin circulating in America was the Spanish silver dollar worth 8 reals, or equal to about one U.S. dollar.
The dollar was divided into "pieces of eight," or "bits," each consisting of one-eighth of a dollar. A one bit coin (or 1 real) was valued at 12½¢. Hence, the term two-bits referring to a 2 real coin or one U.S. quarter dollar.