---
title: "encode(_:)"
framework: combine
role: symbol
role_heading: Instance Method
path: "combine/toplevelencoder/encode(_:)"
---

# encode(_:)

Encodes an instance of the indicated type.

## Declaration

```swift
func encode<T>(_ value: T) throws -> Self.Output where T : Encodable
```

## Parameters

- `value`: The instance to encode.
