Sodium metal oxides with layered structures have received considerable attention as positive electrode materials for Na-ion batteries due to high reversible capacity. Sodium layered oxides would be more promising candidates than lithium-compounds in terms of high stability of MO2 slabs after extraction of Na induced from larger ionic size of Na. In addition, rich crystal chemistry for sodium layered compounds is available since larger Na+ ion is stable in more spacious prismatic site as compared to Li+ ion. In view of this, the phase transformation of layered compounds during electrochemical reaction is generally considered to be a pivotal feature for understanding the relationship between layered structures and electrochemical properties. Here the structure, phase stability, and electrochemical properties of two kinds of layered oxides, P2 and O3, are investigated through in situ synchrotron XRD experiments. A capillary Na-based cell is designed to minimize interference in other substances such as a separator or external battery parts. This approach could give us to obtain clear diffraction patterns with high intensity during electrochemical reaction in a short period of time without further relaxation step. We carefully scrutinized reversible structural phase transformations during electrochemical reaction of P2 and O3-layered compounds based on in situ XRD analysis, and detailed results will be discussed.