# What is the difference/relation between position and index?

**URL:** https://discuss.prosemirror.net/t/what-is-the-difference-relation-between-position-and-index/5013
**Category:** Uncategorized
**Created:** [November 10, 2022, 11:51am UTC](https://discuss.prosemirror.net/t/what-is-the-difference-relation-between-position-and-index/5013 "2022-11-10T11:51:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![razyalov](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/razyalov/32/2091_2.png) [@razyalov](https://discuss.prosemirror.net/u/razyalov)
#### Post date: [November 10, 2022, 11:51am UTC](https://discuss.prosemirror.net/t/what-is-the-difference-relation-between-position-and-index/5013/1 "2022-11-10T11:51:05Z")

</div>

I’m really confused on the difference between an index and a position. Can someone give a good example of how they relate to a document structure and why do we need both an index and a position?

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [November 10, 2022, 1:32pm UTC](https://discuss.prosemirror.net/t/what-is-the-difference-relation-between-position-and-index/5013/2 "2022-11-10T13:32:34Z")

</div>

Index is the amount of sibling nodes that come before a node in its parent, position is the actual document-wide token offset of a node.
