Object Detection Label Format Converter (YOLO, COCO, Pascal VOC)
Convert computer vision annotation files between YOLO (.txt), COCO (.json), and Pascal VOC (.xml) formats directly in your browser with batch processing.
๐ Object Detection Annotation Formats: YOLO vs. COCO JSON vs. Pascal VOC XML
Computer vision datasets store bounding box annotations in incompatible coordinate systems and file structures. Ultralytics YOLO models expect normalized center coordinates in per-image plain text files, Torchvision and MMDetection pipelines rely on a monolithic COCO JSON schema with absolute top-left coordinates, and legacy annotation suites like LabelImg output Pascal VOC XML files. The DevPanda Label Format Converter performs instantaneous, lossless batch conversion across all three standards entirely inside your browser.
๐ How to Use This Tool
- Select your Source Format (YOLO .txt, COCO .json, or Pascal VOC .xml) and your desired Target Format.
- Provide image dimensions (Width and Height in pixels) and class label names when converting from normalized YOLO files, as YOLO .txt files do not embed image resolution or class strings.
- Drag and drop single or multiple annotation files into the upload zone, or load sample annotations to test the pipeline.
- Preview the converted coordinates side-by-side and download individual files or a batch archive.
๐ Coordinate System Mathematics & Normalization
- YOLO Format (.txt): Each line represents
, where all four spatial values are normalized floats in [0.0, 1.0] obtained by dividing pixel values by image width W and image height H. - COCO Format (.json): Stores bounding boxes as [x_min, y_min, width, height] in absolute pixel coordinates, alongside global categories[], images[], and annotations[] relational tables.
- Pascal VOC Format (.xml): Uses an XML tree per image with
tags containing absolute pixel boundaries , , , and . Converting VOC to COCO requires computing width = xmax - xmin and height = ymax - ymin.
โ Frequently Asked Questions (FAQ)
Q. Why do I need image width and height when converting from YOLO to COCO or VOC?
YOLO stores relative coordinates (e.g., x_center = 0.5). Without knowing whether the original image is 640ร640 or 1920ร1080, it is mathematically impossible to recover exact pixel coordinates for COCO or Pascal VOC.
Q. Are my proprietary dataset annotations uploaded to any server?
Never. All XML, JSON, and TXT parsing is executed locally in your browser using the JavaScript FileReader API. Confidential medical, defense, or industrial datasets remain 100% on your machine.
Q. Does YOLO use 0-indexed or 1-indexed class IDs?
YOLO strictly requires 0-indexed contiguous integer class IDs (0 to N-1). Standard COCO datasets sometimes start category IDs at 1; our converter automatically normalizes category indices to prevent index-out-of-bounds errors during training.