# Getting the Tag Array

**URL:** https://discussions.unity.com/t/getting-the-tag-array/19288
**Category:** Questions & Answers
**Created:** [April 12, 2011, 3:17pm UTC](https://discussions.unity.com/t/getting-the-tag-array/19288 "2011-04-12T15:17:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![anon16398198](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@anon16398198](https://discussions.unity.com/u/anon16398198)
#### Post date: [April 12, 2011, 3:17pm UTC](https://discussions.unity.com/t/getting-the-tag-array/19288/1 "2011-04-12T15:17:41Z")

</div>

Anyone know how to get it? I need to access it during editor mode in order to make an editor window that shows them.

---

<div class="post-metadata">

### Author: ![yoyo](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/yoyo/32/525848_2.png) [@yoyo](https://discussions.unity.com/u/yoyo)
#### Post date: [April 12, 2011, 4:09pm UTC](https://discussions.unity.com/t/getting-the-tag-array/19288/2 "2011-04-12T16:09:22Z")

</div>

[EditorGUI.TagField](http://unity3d.com/support/documentation/ScriptReference/EditorGUI.TagField.html) gives you a selector for choosing a tag.

What you really want though, is `UnityEditorInternal.InternalEditorUtility.tags`, which is a string array of all tags in the system. This is a public but undocumented internal feature, so it may break in future releases of Unity.

---

<div class="post-metadata">

### Author: ![dsh](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsh](https://discussions.unity.com/u/dsh)
#### Post date: [March 10, 2013, 5:21pm UTC](https://discussions.unity.com/t/getting-the-tag-array/19288/3 "2013-03-10T17:21:40Z")

</div>

string to\_search\_tag=“Player”;  
for (int i = 0; i \< UnityEditorInternal.InternalEditorUtility.tags.Length; i++) {  
if (UnityEditorInternal.InternalEditorUtility.tags\*.Contains(to\_search\_tag)) {\*  
_Debug.Log ("At Position " + i + " is the Tag " + to\_search\_tag + " found 🙂 ");_  
_break;// attention : the first index is 0 !!!_  
_}else{_  
_}_  
_}_
