First, EDI is short for "Electronic Document Interchange". It's a big word for exchanging data between companies.
ANSI is short for "American National Standards Institute", which is why ANSI is widely used in American, but isn't used by most of the rest of the world.
X12 is a standard for Electronic Data Interchange (EDI) developed and maintained by the American National Standards Institute (ANSI) Accredited Standards Committee (ASC). The X12 standard governs the exchange of business documents (e.g., purchase orders, invoices, healthcare claims, etc.)