You cannot determine this solely by the ticker length.
However, there are some conventions that may help steer you there.
Nasdaq has 2-4 base letters
BATS has 4 base letters
NYSE equity securities have 1-4 base letters.
NYSE Mkt (formerly Amex) have 1-4 base letters.
NYSE Arca has 4 base letters
OTC has 4 base letters.
Security types other than equities may have additional letters added, and each exchange (and data vendors) have different conventions for how this is handled.
So if you see "T" for a US-listed security it would be only be either NASDAQ, NYSE or NYSE Mkt.
If you see "ANET" then you cannot tell which exchange it is listed on. (In this case, ANET Arista Networks is actually a NYSE stock).
For some non-equity security types, such as hybrids, and debt instruments, some exchanges add "P" to the end for "preferreds" (Nasdaq and OTC) and NYSE/NYSE Mkt have a variety of methods (including not adding anything) to the ticker. Examples include NYSE:TFG, NYSEMkt:IPB, Nasdaaq: AGNCP, Nasdaq:OXLCN. It all becomes rather confusing given the changes in conventions over the years.
Essentially, you require data that provides you with ticker, listing location and security type.
The exchanges allocate security tickers in conjunction with the SEC so there are no overlaps. eg. The same ticker cannot represent two different securities.
However, tickers can be re-used. For example, the ticker AB has been used by the following companies:
- Ambac Industries Inc Common Share (delisted July 1978)
- ABA Industries Inc Common Share (delisted January 1983)
- ABI American Businessphones Common Share (delisted October 1988)
- Alex Brown Inc Common Share (delisted August 1997)
- Cannon Express Inc Common Share (delisted October 2003)
- AllianceBernstein Holding L.P. Unit (currently listed)