Question: why hcl is used in flame test?
Answer: The purpose of using conc. HCl is to convert the compounds into their metallic chlorides. Because, the metallic chlorides are very much volatile. When heated in the flame the elements of the metals of the compounds become excited and go to higher energy levels.