One self-contained library that translates, validates, acknowledges and rebuilds X12 - at native speed

Everything you need to work with X12 and HIPAA files, in a single library file you ship next to your own binary, and it is included in every plan.
Native performance

Compiled to native code with zero-copy UTF-8 buffers and streaming split/merge for high-throughput EDI processing.

Zero dependencies

A single self-contained shared library per platform. No .NET runtime, JVM, or install step needed on the target machine.

EDI to JSON and back

Translate between EDI data and structured JSON: a whole X12 interchange to JSON in one call with parse, and back again with build.

Streaming split & merge

Process one transaction set or segment at a time with flat, low memory use - ideal for very large interchange files.

Built-in validation

Validate transaction sets with configurable SNIP levels, regex, date/time formats, and error limits, for a detailed report.

Acknowledgments

Automatically generate 999, 997, and TA1 acknowledgments from validated interchanges in a single operation mode.

Translate EDI to JSON in a few lines

The same UTF-8 buffer, grow-and-retry, and status-code contract from any FFI-capable language. Each tab is a real binding you can clone.
import ctypes, json
lib = ctypes.CDLL("./edifabric-x12-tools.so") 
lib.parse.restype = ctypes.c_int
def parse(edi: bytes, mode: int = 1) -> str:
    cap = len(edi) * 12
    out_len = ctypes.c_int(0); out_off = ctypes.c_int(0)
    while True:
        out = ctypes.create_string_buffer(cap)
        rc = lib.parse(edi, len(edi), mode, None, 0, out, cap,
                       ctypes.byref(out_len), ctypes.byref(out_off))
        if rc == 1:
            cap = out_len.value; continue
        if rc != 0:
            raise RuntimeError(f"parse failed: {rc}")
        return out.raw[:out_len.value].decode("utf-8")
// P/Invoke into the native library
[DllImport("edifabric-x12-tools", EntryPoint = "parse")]
static extern unsafe int Parse(byte* input, int inputLen, int mode,
                            byte* config, int configLen,
                            byte* output, int outputCap,
                            int* outputLen, int* outputOffset);

static unsafe string Parse(byte[] edi, int mode = 1)
{
    int cap = edi.Length * 12, len, off;
    while (true)
    {
        var outBuf = new byte[cap];
        fixed (byte* pIn = edi, pOut = outBuf)
        {
            int rc = Parse(pIn, edi.Length, mode, null, 0, pOut, cap, &len, &off);
            if (rc == 1) { cap = len; continue; }   // grow & retry
            if (rc != 0) throw new Exception($"parse failed: {rc}");
            return Encoding.UTF8.GetString(outBuf, 0, len);
        }
    }
}
// JNA maps the native entry points to ordinary Java methods
interface EdiFabricLib extends Library {
    EdiFabricLib INSTANCE = Native.load("edifabric-x12-tools", EdiFabricLib.class);
    int parse(byte[] in, int inLen, int mode,
    byte[] cfg, int cfgLen,
    byte[] out, int cap, IntByReference outLen, IntByReference outOff);
}

static String parse(byte[] edi) {
    int cap = edi.length * 12;
    while (true) 
    {
        byte[] out = new byte[cap];
        IntByReference len = new IntByReference();
        int rc = EdiFabricLib.INSTANCE.parse(edi, edi.length, 1,
        null, 0, out, cap, len, new IntByReference());
        if (rc == 1) { cap = len.getValue(); continue; }
        if (rc != 0) throw new RuntimeException("parse failed: " + rc);
        return new String(out, 0, len.getValue(), StandardCharsets.UTF_8);
    }
}
/* Declare the entry points exported by the native library */
extern int  set_map(const unsigned char* map, int len);
extern int  parse(const unsigned char* in, int inLen, int mode,
                            const unsigned char* cfg, int cfgLen,
                            unsigned char* out, int cap, int* outLen, int* outOff);
extern void* get_error(int code);

/* EDI -> JSON, growing the buffer once if it is too small */
int edi_to_json(const unsigned char* edi, int ediLen, unsigned char** out, int* outLen) {
     int cap = ediLen * 12, off = 0;
     *out = malloc(cap);
     int rc = parse(edi, ediLen, 1, NULL, 0, *out, cap, outLen, &off);
     if (rc == 1) {                     /* InsufficientCapacity */
        *out = realloc(*out, *outLen);
        rc = parse(edi, ediLen, 1, NULL, 0, *out, *outLen, outLen, &off);
    }
    return rc;                          /* 0 = success */
}

Official bindings for your language

Thin, idiomatic wrappers over the same C entry points, so you do not have to write the FFI plumbing yourself. Clone one, point it at the library file, and start translating.
Python

A ctypes wrapper for Python that handles the grow-and-retry buffer for you.

View on GitHub
Java

JNA bindings for Java that map the native entry points to plain Java methods.

View on GitHub
C# and .NET

P/Invoke bindings, for when you want the native library rather than ediFabric .NET.

View on GitHub
C and C++

The reference header and examples that define the ABI every other binding wraps.

View on GitHub

Working in Rust, Go, Node.js or something else? They all call the same handful of C entry points, so the C bindings document contains everything you need. Tell us which language you are on and we will help you wire it up.


You do not buy ediFabric Native on its own

Every plan includes ediFabric .NET, ediFabric Native and ediFabric Cloud. Pick Native because a C FFI suits your stack, not because of what it costs.
Included in every plan
Free forever to start

Community costs nothing and never expires, giving you 250 operations a day and one leased seat for non-production work. Developer and Enterprise lift the quota and the seat count, and all three include the same library.

X12 and HIPAA today
More standards to follow

Native is the newest of the three and covers X12 and HIPAA, with the remaining standards being released one at a time. If you need EDIFACT, HL7, NCPDP or flat files right now, use ediFabric .NET or ediFabric Cloud — your plan already includes them.

Your EDI data is safe
Nothing reaches us

Every operation runs inside your own process, on your own hardware. No EDI data and no PHI is ever transported to us, so Native sits entirely within the controls you already have in place for HIPAA or SOC 2.

Start translating X12 today

Drop the library next to your binary, authorize it with your serial key, and translate your first interchange in minutes. The free Community plan needs no credit card and never expires.