There are three numbers along the bottom of a US check and people mix them up constantly, usually with expensive consequences when setting up a direct deposit. They are printed in a machine readable band and the order is standardised, so once you know which is which you can read any check in a couple of seconds. This page sets out the layout and the two exceptions to it.
The standard layout, left to right
Reading along the bottom of the check from the left, the first block is the nine digit routing number, which identifies the bank. The second block is the account number, which identifies your account and has no fixed length. The third, usually shortest, block is the check number, which matches the number printed in the top right corner of the check. Matching that third block to the corner is the quickest way to confirm you have read the layout correctly.
How to tell the routing number from the account number
Count the digits. A routing number is always exactly nine, and no US account number is required to be nine, so a nine digit block in the leftmost position is the routing number. The account number varies by bank and can run from a few digits up to seventeen. If both blocks happen to be nine digits, use position: the routing number comes first and is bracketed by the machine readable symbols that mark it.
The two exceptions worth knowing
First, some business checks place the check number in the leftmost position, so the order becomes check number, routing number, account number. Matching the number in the top right corner tells you immediately whether this is one of those. Second, the routing number printed on a personal check is often the one used for direct deposits and ACH, while a wire transfer may need a different routing number that the bank publishes separately. Several large US banks say so explicitly on their own pages.
Reading it without a check
Many people no longer have a checkbook. The same two numbers are shown on the account details screen of your bank's app and on a statement, and most banks publish a page telling you where. Reading them from the app is better anyway, because it distinguishes the direct deposit routing number from the wire routing number, which a printed check does not. If you are setting up a payroll deposit, use whatever the employer's form specifies.
Questions people ask about where is your account number on a check
Which number on a check is the account number?
The middle block along the bottom, between the nine digit routing number on the left and the check number on the right.
How long is a US account number?
There is no fixed length. It varies by bank and commonly runs from a handful of digits up to seventeen.
Why does my check show the check number first?
Some business check formats put it in the leftmost position. Match the number to the one printed in the top right corner to confirm.
Is the routing number on my check the right one for a wire?
Often not. Many US banks publish a separate wire routing number, so check the bank's own page before sending wire instructions.