In a method for manufacturing a flexible memory device and semiconductor device, a stack including an element layer and an insulating layer which seals the element layer is formed over a substrate having a separation layer, and the stack is separated from the separation layer. The element layer includes a memory element having a layer containing an organic compound between a pair of electrodes, a first electrode layer and a second electrode layer, and at least one of the pair of electrode layers is formed using an alloy layer containing tin. The flexible memory device and semiconductor device include a memory element having a layer containing an organic compound between a pair of electrodes, a first electrode layer and a second electrode layer, in which at least one of the pair of electrode layers is formed using an alloy layer containing tin.