# Content conversion

## Table of Contents

- [Supported source formats](#supported-source-formats)
- [Choose the output](#choose-the-output)
- [The shared pattern](#the-shared-pattern)
- [Go deeper](#go-deeper)

---

Point [url](https://microlink.io/docs/api/parameters/url) at anything and pick the output with [attr](https://microlink.io/docs/sdk/methods/extract/attr). Documents are converted to an HTML DOM at fetch time, so the same rule reads a PDF or `.docx` just like a web page.

## Supported source formats

| Type              | Extension |
| ----------------- | --------- |
| Web page          | `html`    |
| PDF               | `pdf`     |
| Word document     | `docx`    |
| Spreadsheet       | `xlsx`    |
| Presentation      | `pptx`    |
| OpenDocument text | `odt`     |
| Rich text         | `rtf`     |
| Ebook             | `epub`    |
| JSON endpoint     | `json`    |

## Choose the output

| Output          | attr       | Guide                                                                                              |
| --------------- | ---------- | -------------------------------------------------------------------------------------------------- |
| Plain text      | `text`     | [URL to Text](https://microlink.io/docs/guides/content-conversion/url-to-text)                     |
| Markdown        | `markdown` | [URL to Markdown](https://microlink.io/docs/guides/content-conversion/url-to-markdown)             |
| HTML            | `html`     | [URL to HTML](https://microlink.io/docs/guides/content-conversion/url-to-html)                     |
| Structured JSON | `json`     | [JSON endpoint to JSON](https://microlink.io/docs/guides/content-conversion/json-endpoint-to-json) |

Each guide shows the same recipe across a web page, a PDF, and an office document.

## The shared pattern

```js
{

url:'https://example.com',

data:{

content:{

attr:'markdown'

}

},

meta:false

}
```

Rename `content` to whatever your app expects, and switch `attr` to change the output. By default the field comes back inside a JSON envelope:

```json
{

"status":"success",

"data":{

"content":"# Example Domain\n\nThis domain is for use..."

}

}
```

Add [embed](https://microlink.io/docs/api/parameters/embed) with the field name to return the converted body directly instead:

```js
{

url:'https://example.com',

data:{

content:{

attr:'markdown'

}

},

meta:false,

embed:'content'

}
```

## Go deeper

- [Data extraction](https://microlink.io/docs/guides/data-extraction) for selectors, scoping, nested fields, collections, typed values, and browser-side evaluation.
- [Private pages](https://microlink.io/docs/guides/common/private-pages) for cookies, authorization headers, and server-side proxying.