Tachograph DDD File Format and a JavaScript Parser

Siarhei Havarunou – CEO

What is inside a tachograph .ddd file, from driver cards to vehicle units and Gen2 v2, and how to parse, verify and check one in Node.js or the browser.

A driver's week of driving, work and rest, drawn from a parsed tachograph .ddd file

A .ddd file is the download of an EU digital tachograph: the binary copy of a driver card or a vehicle unit that a transport company must take regularly and keep for at least a year. It holds the driver’s activities minute by minute, the vehicles used, places, events, faults and, on newer units, GNSS positions and border crossings, all signed so that any change to a single byte is detectable. This guide explains what sits inside the file and how to read one in code with dddparser, an open-source TypeScript library we publish under the MIT licence. It parses every card type and vehicle unit download from Gen1 to Gen2 version 2, verifies the signatures, and checks driving and rest times against Regulation (EC) 561/2006, in Node.js or in the browser.

dddparser on GitHub · Package on npm

What a .ddd file is, and the other extensions

Two devices produce tachograph downloads, and the file looks different for each:

SourceWhat it holdsCommon extensions
Driver cardThe driver’s activities for about 28 days or more, vehicles used, places, events, faults.ddd, .c1b, .tgd
Vehicle unit (VU)The vehicle’s overview, activities of both slots, events and faults, detailed speed, technical data.ddd, .v1b, .tgd
Workshop, control and company cardsCalibrations, controls carried out, company locks and downloads.ddd

The extension does not change the content. .c1b and .v1b are names some download tools give to card and vehicle unit files, and .tgd is the name used in Spain. The first byte tells them apart: a vehicle unit download starts with 0x76, a card download does not.

Three generations are in use. Gen1 tachographs have been fitted since 2006. Gen2, the smart tachograph, arrived in 2019 with GNSS positions and new cryptography. Gen2 version 2, fitted since 2023 under Regulation (EU) 2021/1228, adds border crossings and load and unload operations. A Gen2 card carries a Gen1 copy of its data as well, so older units can still read it.

How a .ddd file is structured

Structure of a driver card .ddd file: elementary files with a five-byte header, Gen1 records and signatures followed by the Gen2 copy

A card download is a list of elementary files (EF). Each record has a five-byte header: a 2-byte file id, one byte that says whether the record is data or a signature and whether it is Gen1 or Gen2, and a 2-byte length. After each data record comes its signature. The ids and the layout of every file are defined in Appendix 1 of Annex 1C to Regulation (EU) 2016/799, the data dictionary.

A vehicle unit download is a list of transfers instead, often called TREPs. Each starts with 0x76 and a transfer type: overview, activities for one day, events and faults, detailed speed, technical data. Gen1, Gen2 and Gen2 v2 use different transfer types, and the download protocol in Appendix 7 decides which ones appear.

Two things follow from this layout. A file cannot be opened in a text editor or Excel, because the content is packed binary with BCD dates, bit fields and code tables. And a parser has to know the generation of each record before it reads it, because the same file id means a different layout in Gen1 and Gen2.

Parse a .ddd file in JavaScript

dddparser has no runtime dependencies, ships TypeScript types and runs in Node.js 20 and later and in modern browsers.

npm install dddparser
import { readFileSync } from "node:fs";
import { parseCard, parseVehicleUnit, daySummary } from "dddparser";

const bytes = readFileSync("driver.ddd");

if (bytes[0] === 0x76) {
  const vu = parseVehicleUnit(bytes); // vehicle unit download
  console.log(vu.generation, vu.overview?.vin, vu.warnings);
} else {
  const card = parseCard(bytes); // driver, workshop, control or company card
  const app = card.gen2 ?? card.gen1;
  console.log(card.cardType, app.identification?.surname, card.warnings);

  for (const day of app.activity ?? []) {
    const { driving, work, availability, rest } = daySummary(day); // minutes
    console.log(day.date, driving, work, availability, rest, day.distanceKm);
  }
}

In the browser, pass the bytes of a file input. The file is read on the user’s device and is never uploaded anywhere, which matters for data that names a driver and records where they were:

const bytes = new Uint8Array(await input.files![0]!.arrayBuffer());
const card = parseCard(bytes);

The parser is lenient on purpose. Records it cannot decode are skipped and listed in warnings, and everything before and after them is returned, so a file damaged in transfer still gives most of its data. ParseError is thrown only when nothing can be read, such as a file that is not a tachograph download at all.

What comes out

Times are ISO 8601 strings in UTC, cyclic buffers come out in chronological order, and unknown values are null. For a card, the result is grouped by generation:

FieldFromCards
identificationCard number, holder or organisation, validityall
activityDays of activity changes, oldest firstdriver, workshop
vehicles, vehicleUnitsVehicles used, with VIN on Gen2driver, workshop
places, gnssPlacesStart and end of daily work, positions on Gen2driver, workshop
events, faultsEvents and faults recorded on the carddriver, workshop
borderCrossings, loadUnloadOperationsGen2 version 2 onlydriver, workshop
calibrationsCalibration recordsworkshop
controllerActivities, companyActivitiesControls carried out, company locks and downloadscontrol, company

A driver's week of driving, work, availability and rest, drawn from parsed card data

dayIntervals(day) turns a day’s activity changes into contiguous intervals covering 00:00 to 24:00 UTC, which is all a chart like the one above needs. A vehicle unit download returns { generation, overview, activities, eventsAndFaults, detailedSpeed, technicalData, warnings }, and slotActivityDay(day, "driver") gives one slot of a day in the same shape as a card day.

Check driving and rest times against 561/2006

import { analyzeDrivingTimes } from "dddparser";

const report = analyzeDrivingTimes(app.activity ?? [], { timeZone: "Europe/Helsinki" });
report.infringements; // { rule, severity, start, end, measuredMinutes, limitMinutes, message }[]
report.remainingToday; // driving minutes left in the current daily period
report.remainingThisWeek;
RuleArticleLimit
Continuous driving74h30 without a 45 min break, or 15 + 30 min
Daily driving6(1)9h, 10h at most twice a week
Weekly driving6(2)56h in a fixed week
Two-week driving6(3)90h in two consecutive weeks
Daily rest8(2)11h, or 3h + 9h, or reduced 9h, within 24h
Reduced daily rests8(4)at most three between weekly rests
Weekly rest8(6)45h, or reduced 24h, within six 24h periods

Infringements of Regulation 561/2006 found in a test driver card

Severity follows a simplified reading of Annex I of Regulation (EU) 2016/403. The result is indicative, not certified analysis software: ferry and train interruptions, exemptions and compensation of reduced weekly rests are not handled. It is good for a dashboard that warns a planner before a roadside check does, and not a replacement for the analysis a company is audited on.

Verify the signatures

Every data record in a .ddd file is signed by the card or the vehicle unit, and that key is certified by a Member State authority, which is certified by the European Root CA. Verifying the chain proves the file came from a real tachograph and was not changed afterwards.

import { verifyCard } from "dddparser";

const report = await verifyCard(bytes);
report.valid; // every chain and every signed record is valid

How Gen1 RSA and Gen2 ECDSA certificate chains are verified up to the European Root CA

Gen1 uses RSA-1024 certificates and SHA-1 signatures. Gen2 uses card-verifiable certificates and ECDSA on the six curves of Annex 1C, the NIST and Brainpool families. The European Root CA keys for both generations are built in, and hashing goes through Web Crypto, so verification also runs in the browser.

Anonymize before sharing

import { anonymize } from "dddparser";

const safe = anonymize(card, { salt: "project-x", gnssPrecision: 1 });

Names, addresses, birth dates, card and licence numbers, VINs and plates are replaced by pseudonyms. The same input and salt give the same pseudonym, so data from several files still joins up, and positions are rounded. This is pseudonymization: timing and distance patterns stay in the data, so treat the output as personal data under GDPR all the same.

From the command line

npx dddparser driver.ddd --compliance

The CLI prints the card holder, card number, vehicles, the last seven days and a count of infringements. --json prints the parsed data, --verify checks the signatures and exits with code 3 when they are not valid, and --anonymize pseudonymizes the JSON.

Other open-source tachograph parsers

ProjectLanguageLicenceCovers
dddparserTypeScriptMITCards and VU, Gen1 to Gen2 v2, signatures, 561/2006
traconiq/tachoparserGoAGPL-3.0Cards and VU, Gen1 to Gen2 v2
way-platform/tachograph-goGoMITCards and VU, signatures, anonymization
DDDTachograph_ReaderPythonMITCards and VU, Gen1 to Gen2 v2, signatures
tachograph-readerC#none statedCards and VU to XML, last updated 2020

In the JavaScript ecosystem, the only other packages on npm are readesm and readesm-js, ports of the ReadESM desktop reader last published in 2023 and 2020. Parts of dddparser’s vehicle unit and security code are ported from tachograph-go, and its test files come from that project.

Limitations

  • Gen2 version 1 vehicle unit downloads are implemented from the specification but not yet tested against a real file.
  • A vehicle unit download that mixes generations is verified only for the generation of its certificates.
  • Compliance analysis is indicative and severity is simplified.
  • dddparser reads files. It does not talk to a card reader or download a vehicle unit over the remote download protocol.

Frequently asked questions

How do I open a .ddd file? A .ddd file needs software that understands the tachograph format: desktop tachograph analysis software, an online viewer such as our free DDD file viewer, or a parser like dddparser if you want the data in your own system. A text editor or Excel shows only binary noise.

Can I edit a .ddd file? No. Every record is signed, so a changed byte makes the signature check fail, and control officers and analysis software treat that file as invalid.

What is the difference between .ddd, .c1b, .v1b and .tgd? Only the name. The content follows the same EU format, and the first byte tells a vehicle unit download from a card download.

Does dddparser read smart tachograph 2 files? Yes. Gen2 version 2 cards and vehicle units are parsed, including border crossings, load and unload operations and authenticated places.

Is the data sent anywhere? No. dddparser is a library that runs in your process or the user’s browser, with no network calls.

When a parser is not enough

dddparser turns a file into data. A fleet usually needs more around it: collecting downloads from card readers and remote download services, storing a year of files with their signatures, matching drivers to vehicles across tracking systems, and putting driving time next to GPS trips and fuel. That is integration work, and the part we build for tracking companies, whether the files end up in a PostgreSQL warehouse, a Wialon account or an ERP.

More from Asset Track

Let's connect

  • “Our client needed a data pipeline. It came back working, plus a few Wialon fixes we had not asked for. That client trusts us more now.”
    Faiz K. Customer Manager · Trakpro Limited