PDF to Excel API

Extract Tables from Any PDF into Editable Excel Spreadsheets.

hero banner

Code Examples in Popular Languages

Integrate our PDF to Excel API easily into your apps with comprehensive code examples in popular languages to get started quickly.

CURL Request
curl --location 'https://theonlineconverter.com/api/v1/document-converter' \
--header 'Content-Type: application/json' \
--header 'x-api-key: enter_your_api_key' \
--form 'from="pdf"' \
--form 'to="excel"' \
--form 'file=@"/D:/data/Document/pdf/other.pdf"'
JavaScript Fetch
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-api-key", "enter_your_api_key");

const formdata = new FormData();
formdata.append("from", "pdf");
formdata.append("to", "excel");
formdata.append("file", fileInput.files[0], "/D:/data/Document/pdf/other.pdf");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://theonlineconverter.com/api/v1/document-converter", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
Ruby Net::HTTP
import requests
import json

url = "https://theonlineconverter.com/api/v1/document-converter"

payload = {'from': 'pdf',
'to': 'excel'}
files=[
  ('file',('other.pdf',open('/D:/data/Document/pdf/other.pdf','rb'),'application/pdf'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
Python Requests
import requests
import json

url = "https://theonlineconverter.com/api/v1/document-converter"

payload = {'from': 'pdf',
'to': 'excel'}
files=[
  ('file',('other.pdf',open('/D:/data/Document/pdf/other.pdf','rb'),'application/pdf'))
]
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'enter_your_api_key'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
PHP Guzzle
<?php
$client = new Client();
$headers = [
  'Content-Type' => 'application/json',
  'x-api-key' => 'enter_your_api_key'
];
$options = [
  'multipart' => [
    [
      'name' => 'from',
      'contents' => 'pdf'
    ],
    [
      'name' => 'to',
      'contents' => 'excel'
    ],
    [
      'name' => 'file',
      'contents' => Utils::tryFopen('/D:/data/Document/pdf/other.pdf', 'r'),
      'filename' => '/D:/data/Document/pdf/other.pdf',
      'headers'  => [
        'Content-Type' => '<Content-type header>'
      ]
    ]
]];
$request = new Request('POST', 'https://theonlineconverter.com/api/v1/document-converter', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
Java HttpURLConnection
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("from","pdf")
  .addFormDataPart("to","excel")
  .addFormDataPart("file","/D:/data/Document/pdf/other.pdf",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/D:/data/Document/pdf/other.pdf")))
  .build();
Request request = new Request.Builder()
  .url("https://theonlineconverter.com/api/v1/document-converter")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("x-api-key", "enter_your_api_key")
  .build();
Response response = client.newCall(request).execute();
Go net/http
package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "net/http"
  "io"
)

func main() {

  url := "https://theonlineconverter.com/api/v1/document-converter"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  _ = writer.WriteField("from", "pdf")
  _ = writer.WriteField("to", "excel")
  file, errFile3 := os.Open("/D:/data/Document/pdf/other.pdf")
  defer file.Close()
  part3,
         errFile3 := writer.CreateFormFile("file",filepath.Base("/D:/data/Document/pdf/other.pdf"))
  _, errFile3 = io.Copy(part3, file)
  if errFile3 != nil {
    fmt.Println(errFile3)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("x-api-key", "enter_your_api_key")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
C# HttpClient
var options = new RestClientOptions("https://theonlineconverter.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/v1/document-converter", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "enter_your_api_key");
request.AlwaysMultipartFormData = true;
request.AddParameter("from", "pdf");
request.AddParameter("to", "excel");
request.AddFile("file", "/D:/data/Document/pdf/other.pdf");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

Key Features & Capabilities

Our API is engineered with powerful features to deliver accurate, structured data from any type of PDF.

Simple User Interface

Native & Scanned PDF Support

Intelligently processes both native (text-based) PDFs for direct data extraction and scanned (image-based) PDFs using our powerful OCR engine.

Simple Data Format

AI-Powered Table Recognition

For scanned PDFs, our OCR accurately identifies table structures—including rows, columns, and cells—to ensure data is correctly organized in the spreadsheet.

Time

High-Accuracy Data Extraction

Preserves the integrity of your data, accurately converting text, numbers, and symbols into the correct cells to minimize manual correction.

Secure Data

Selective Page Processing

Optimize performance and target specific data by instructing the API to only process certain pages or page ranges within a large document.

Universal Access

Structured Excel Output

Receive a well-organized, ready-to-use XLSX file. The extracted tables are structured into clean rows and columns, mirroring the source document.

Freedom

Secure & Confidential

All documents are processed over encrypted connections. We guarantee confidentiality with a strict data privacy policy and do not store your files.

Frequently Asked Questions

Find answers to common questions about our PDF to Excel API to understand its capabilities and achieve the best results.

The API automatically detects the type of PDF. If it finds a text layer, it performs direct data extraction. If it's an image-based file, it automatically engages the advanced OCR engine to read the tables.

For native PDFs, the accuracy is extremely high. For scanned PDFs, accuracy is excellent but depends on the scan quality. Clear, high-resolution scans with standard printed fonts yield the best results.

Yes. The `pages` parameter allows you to specify exactly which pages you want to process (e.g., "1-3, 7"), which saves significant processing time on large documents.

You can control the output. By default, all tables from a page are placed in a single sheet. You can also set an option to have each detected table placed in a separate sheet within the same Excel file for better organization.

Yes. To process a password-protected file, you must provide the correct password within your API request, which allows us to decrypt and read the document.

The API response will provide a secure, time-limited download link to the generated XLSX spreadsheet.

Absolutely. We use end-to-end TLS encryption for all data transfers. Your files are processed in a secure environment and are permanently deleted from our servers immediately after the conversion.